[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191008123201.qk5yfeys4ahpjopp@mail.google.com>
Date: Tue, 8 Oct 2019 20:32:02 +0800
From: Changbin Du <changbin.du@...il.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Changbin Du <changbin.du@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 0/2] perf: add support for logging debug messages to
file
On Mon, Oct 07, 2019 at 01:26:24PM +0200, Jiri Olsa wrote:
> On Fri, Oct 04, 2019 at 10:39:52AM +0800, Changbin Du wrote:
> > When in TUI mode, it is impossible to show all the debug messages to
> > console. This make it hard to debug perf issues using debug messages.
> > This patch adds support for logging debug messages to file to resolve
> > this problem.
> >
> > v3:
> > o fix a segfault issue.
>
> heya,
> getting segfault for this:
>
> [jolsa@...va perf]$ ./perf report -vv 2>out
> Segmentation fault (core dumped)
>
This can be fixed by below change. In this case, log_file is NULL.
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -37,8 +37,10 @@ int veprintf(int level, int var, const char *fmt, va_list args)
if (var >= level) {
if (use_browser >= 1 && !log_file)
ui_helpline__vshow(fmt, args);
- else
+ else if (log_file)
ret = vfprintf(log_file, fmt, args);
+ else
+ ret = vfprintf(stderr, fmt, args);
}
return ret;
> jirka
>
> > v2:
> > o specific all debug options one time.
> >
> > Changbin Du (2):
> > perf: support multiple debug options separated by ','
> > perf: add support for logging debug messages to file
> >
> > tools/perf/Documentation/perf.txt | 15 ++--
> > tools/perf/util/debug.c | 124 +++++++++++++++++++-----------
> > 2 files changed, 90 insertions(+), 49 deletions(-)
> >
> > --
> > 2.20.1
> >
--
Cheers,
Changbin Du
Powered by blists - more mailing lists