Skip to content

Commit

Permalink
perf record: Remove newline character from perror() argument
Browse files Browse the repository at this point in the history
If we include a newline character in the string argument to perror()
then the output will be split across two lines like so,

    Unable to read perf file descriptor
    : No space left on device

Deleting the newline character prints a much more readable error,

    Unable to read perf file descriptor: No space left on device

Cc: Peter Zijlstra <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Tom Zanussi <[email protected]>
LKML-Reference: <89e77b54659bc3798b23a5596c2debb7f6f4cf27.1283010281.git.matt@console-pimps.org>
Signed-off-by: Matt Fleming <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
mfleming authored and Arnaldo Carvalho de Melo committed Oct 26, 2010
1 parent 7f6c1bd commit 0ab7368
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static void create_counter(int counter, int cpu)
}

if (read(fd[nr_cpu][counter][thread_index], &read_data, sizeof(read_data)) == -1) {
perror("Unable to read perf file descriptor\n");
perror("Unable to read perf file descriptor");
exit(-1);
}

Expand Down Expand Up @@ -626,7 +626,7 @@ static int __cmd_record(int argc, const char **argv)

nr_cpus = read_cpu_map(cpu_list);
if (nr_cpus < 1) {
perror("failed to collect number of CPUs\n");
perror("failed to collect number of CPUs");
return -1;
}

Expand Down

0 comments on commit 0ab7368

Please sign in to comment.