From: Namhyung Kim <namhyung@gmail.com>
To: Stanislav Ivanichkin <sivanichkin@yandex-team.ru>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
linux-perf-users <linux-perf-users@vger.kernel.org>,
Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
Subject: Re: [PATCH v2] perf trace: Segfault when trying to trace events by cgroup
Date: Tue, 27 Oct 2020 14:10:42 +0900 [thread overview]
Message-ID: <CAM9d7chkb_ramqnS_0LSbtY-gya3XAyHao2+bNjE=T3YJDTptg@mail.gmail.com> (raw)
In-Reply-To: <20201026132034.80464-1-sivanichkin@yandex-team.ru>
Hello,
On Mon, Oct 26, 2020 at 10:21 PM Stanislav Ivanichkin
<sivanichkin@yandex-team.ru> wrote:
>
> v2:
> - struct declaration fixed (Namhyung Kim)
>
> Fixes: 9ea42ba4411ac ("perf trace: Support setting cgroups as targets")
> Signed-off-by: Stanislav Ivanichkin <sivanichkin@yandex-team.ru>
Looks ok but you'd better add the commit description in v1.
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks
Namhyung
> ---
> tools/perf/builtin-trace.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index 44a75f234db1..de80534473af 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -4639,9 +4639,9 @@ static int trace__parse_events_option(const struct option *opt, const char *str,
> err = 0;
>
> if (lists[0]) {
> - struct option o = OPT_CALLBACK('e', "event", &trace->evlist, "event",
> - "event selector. use 'perf list' to list available events",
> - parse_events_option);
> + struct option o = {
> + .value = &trace->evlist,
> + };
> err = parse_events_option(&o, lists[0], 0);
> }
> out:
> @@ -4655,9 +4655,12 @@ static int trace__parse_cgroups(const struct option *opt, const char *str, int u
> {
> struct trace *trace = opt->value;
>
> - if (!list_empty(&trace->evlist->core.entries))
> - return parse_cgroups(opt, str, unset);
> -
> + if (!list_empty(&trace->evlist->core.entries)) {
> + struct option o = {
> + .value = &trace->evlist,
> + };
> + return parse_cgroups(&o, str, unset);
> + }
> trace->cgroup = evlist__findnew_cgroup(trace->evlist, str);
>
> return 0;
> --
> 2.17.1
>
prev parent reply other threads:[~2020-10-27 5:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 13:20 [PATCH v2] perf trace: Segfault when trying to trace events by cgroup Stanislav Ivanichkin
2020-10-27 5:10 ` Namhyung Kim [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='CAM9d7chkb_ramqnS_0LSbtY-gya3XAyHao2+bNjE=T3YJDTptg@mail.gmail.com' \
--to=namhyung@gmail.com \
--cc=dmtrmonakhov@yandex-team.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sivanichkin@yandex-team.ru \
/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;
as well as URLs for NNTP newsgroup(s).