OSDN Git Service

perf trace: Fix alignment for [continued] lines
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 7 Jan 2019 19:54:38 +0000 (16:54 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 8 Jan 2019 16:28:12 +0000 (13:28 -0300)
We were not taking into account the "... [continued]" printed
characters, fix it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-qt20y0acmf8k0bzisce8kw95@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-trace.c

index b8bf5d0..ed45831 100644 (file)
@@ -2032,9 +2032,10 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel,
        if (ttrace->entry_pending) {
                printed = fprintf(trace->output, "%s", ttrace->entry_str);
        } else {
-               fprintf(trace->output, " ... [");
+               printed += fprintf(trace->output, " ... [");
                color_fprintf(trace->output, PERF_COLOR_YELLOW, "continued");
-               fprintf(trace->output, "]: %s()", sc->name);
+               printed += 9;
+               printed += fprintf(trace->output, "]: %s()", sc->name);
        }
 
        printed++; /* the closing ')' */