From: Changbin Du <changbin.du@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Changbin Du <changbin.du@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Namhyung Kim <namhyung@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/2] perf: add support for logging debug messages to file
Date: Tue, 8 Oct 2019 20:32:02 +0800 [thread overview]
Message-ID: <20191008123201.qk5yfeys4ahpjopp@mail.google.com> (raw)
In-Reply-To: <20191007112624.GG6919@krava>
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@krava 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
prev parent reply other threads:[~2019-10-08 12:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-04 2:39 [PATCH v3 0/2] perf: add support for logging debug messages to file Changbin Du
2019-10-04 2:39 ` [PATCH v3 1/2] perf: support multiple debug options separated by ',' Changbin Du
2019-10-04 2:39 ` [PATCH v3 2/2] perf: add support for logging debug messages to file Changbin Du
2019-10-07 11:26 ` [PATCH v3 0/2] " Jiri Olsa
2019-10-08 12:32 ` Changbin Du [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191008123201.qk5yfeys4ahpjopp@mail.google.com \
--to=changbin.du@gmail.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox