From: Yafang Shao <laoar.shao@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Kees Cook <keescook@chromium.org>, Petr Mladek <pmladek@suse.com>,
David Hildenbrand <david@redhat.com>,
Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Linux MM <linux-mm@kvack.org>, bpf <bpf@vger.kernel.org>,
"linux-perf-use." <linux-perf-users@vger.kernel.org>,
Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Michal Miroslaw <mirq-linux@rere.qmqm.pl>,
Peter Zijlstra <peterz@infradead.org>,
Matthew Wilcox <willy@infradead.org>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH -mm 4/5] tools/perf: replace hard-coded 16 with TASK_COMM_LEN
Date: Thu, 9 Dec 2021 10:42:15 +0800 [thread overview]
Message-ID: <CALOAHbAP7w95r_soihp+i1NjWxz4KVHGizARpX80wuL3ZLO7Uw@mail.gmail.com> (raw)
In-Reply-To: <20211208134304.615abbbf@gandalf.local.home>
On Thu, Dec 9, 2021 at 2:43 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Sat, 4 Dec 2021 09:52:55 +0000
> Yafang Shao <laoar.shao@gmail.com> wrote:
>
> > @@ -43,7 +45,7 @@ static int test__perf_evsel__tp_sched_test(struct test_suite *test __maybe_unuse
> > return -1;
> > }
> >
> > - if (evsel__test_field(evsel, "prev_comm", 16, false))
> > + if (evsel__test_field(evsel, "prev_comm", TASK_COMM_LEN, false))
> > ret = -1;
> >
> > if (evsel__test_field(evsel, "prev_pid", 4, true))
> > @@ -55,7 +57,7 @@ static int test__perf_evsel__tp_sched_test(struct test_suite *test __maybe_unuse
> > if (evsel__test_field(evsel, "prev_state", sizeof(long), true))
> > ret = -1;
> >
> > - if (evsel__test_field(evsel, "next_comm", 16, false))
> > + if (evsel__test_field(evsel, "next_comm", TASK_COMM_LEN, false))
> > ret = -1;
> >
> > if (evsel__test_field(evsel, "next_pid", 4, true))
> > @@ -73,7 +75,7 @@ static int test__perf_evsel__tp_sched_test(struct test_suite *test __maybe_unuse
> > return -1;
> > }
> >
> > - if (evsel__test_field(evsel, "comm", 16, false))
> > + if (evsel__test_field(evsel, "comm", TASK_COMM_LEN, false))
>
> Shouldn't all these be TASK_COMM_LEN_16?
>
The value here must be the same with TASK_COMM_LEN, so I use TASK_COMM_LEN here.
But we may also change the code as
https://lore.kernel.org/lkml/20211101060419.4682-9-laoar.shao@gmail.com/
if TASK_COMM_LEN is changed, so TASK_COMM_LEN_16 is also okay here.
I will change it to TASK_COMM_LEN_16 in the next version.
>
> > ret = -1;
> >
> > if (evsel__test_field(evsel, "pid", 4, true))
>
--
Thanks
Yafang
next prev parent reply other threads:[~2021-12-09 2:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-04 9:52 [PATCH -mm 0/5] Phase 2 of task comm cleanups Yafang Shao
2021-12-04 9:52 ` [PATCH -mm 1/5] elfcore: replace old hard-code 16 with TASK_COMM_LEN_16 Yafang Shao
2021-12-08 18:39 ` Steven Rostedt
2021-12-04 9:52 ` [PATCH -mm 2/5] cn_proc: replaced old hard-coded " Yafang Shao
2021-12-08 18:40 ` Steven Rostedt
2021-12-04 9:52 ` [PATCH -mm 3/5] samples/bpf/tracex2: replace hard-coded 16 with TASK_COMM_LEN Yafang Shao
2021-12-04 16:45 ` Alexei Starovoitov
2021-12-04 9:52 ` [PATCH -mm 4/5] tools/perf: " Yafang Shao
2021-12-08 18:43 ` Steven Rostedt
2021-12-09 2:42 ` Yafang Shao [this message]
2021-12-04 9:52 ` [PATCH -mm 5/5] bpf/progs: " Yafang Shao
2021-12-04 16:44 ` Alexei Starovoitov
2021-12-05 2:44 ` Yafang Shao
2021-12-05 3:13 ` Alexei Starovoitov
2021-12-05 7:25 ` Yafang Shao
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=CALOAHbAP7w95r_soihp+i1NjWxz4KVHGizARpX80wuL3ZLO7Uw@mail.gmail.com \
--to=laoar.shao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=arnaldo.melo@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=david@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@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;
as well as URLs for NNTP newsgroup(s).