Re: [PATCH v4 1/3] trace-cmd: Make read_proc() to return int status via OUT arg

From: Steven Rostedt
Date: Fri Jan 19 2018 - 16:58:45 EST



Just to let you know. I accepted all three of your patches. I have one
comment, (and changed this myself).

On Tue, 16 Jan 2018 21:53:41 +0200
"Vladislav Valtchev (VMware)" <vladislav.valtchev@xxxxxxxxx> wrote:

> file and then parse it as an integer using strtol(). Then, it makes the function

This line is 80 characters. For commit logs, we recommend no more than
76 characters (some people suggest 74). The reason is that a git show
will add 4 characters, to each line of the log, and this will cause an
overflow like this:

commit 68f00f512883fa7f1d04a7d88defff5e687bd98f
Author: Vladislav Valtchev (VMware) <vladislav.valtchev@xxxxxxxxx>
Date: Tue Jan 16 21:53:41 2018 +0200

trace-cmd: Make read_proc() to return int status via OUT arg

This patch changes both the implementation and the interface of read_proc()
in trace-stack.c. First, it makes the function to read a string from the pro
c
file and then parse it as an integer using strtol(). Then, it makes the func
tion
to return the integer read from the proc file using the int *status OUT
parameter, in order to make possible its return value to be used by the call
er
to check if the operation succeeded.

This new implementation relaxes the external contraints the function relies
on,
making it possible to be used by trace stat. The point is that 'stat' should
not
fail in case there is something wrong with the stack tracer. Only the call t
o
die() in case the file is empty has been left in this patch: it will be remo
ved
as well in a separate commit.


When editing a git log with the vim editor, I usually do :set tw=76

Thanks!

-- Steve