From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
Athira Jajeev <atrajeev@linux.vnet.ibm.com>,
James Clark <james.clark@linaro.org>,
Dominique Martinet <asmadeus@codewreck.org>,
Yang Li <yang.lee@linux.alibaba.com>,
Colin Ian King <colin.i.king@gmail.com>,
Yang Jihong <yangjihong@bytedance.com>,
"Steinar H. Gunderson" <sesse@google.com>,
Oliver Upton <oliver.upton@linux.dev>,
Ilkka Koskinen <ilkka@os.amperecomputing.com>,
Ze Gao <zegao2021@gmail.com>, Weilin Wang <weilin.wang@intel.com>,
Ben Gainey <ben.gainey@arm.com>,
zhaimingbing <zhaimingbing@cmss.chinamobile.com>,
Zixian Cai <fzczx123@gmail.com>, Andi Kleen <ak@linux.intel.com>,
Paran Lee <p4ranlee@gmail.com>,
Thomas Falcon <thomas.falcon@intel.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
"Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: Re: [PATCH v2 4/6] perf evsel: Add/use accessor for tp_format
Date: Tue, 5 Nov 2024 16:52:45 -0300 [thread overview]
Message-ID: <Zyp3jeLz4ympxfHv@x1> (raw)
In-Reply-To: <CAP-5=fUNR_t8R33enM1WHzR1-ZzZMUDM1hTLohPdefbKfhMSXA@mail.gmail.com>
On Tue, Nov 05, 2024 at 11:33:09AM -0800, Ian Rogers wrote:
> On Tue, Nov 5, 2024 at 9:36 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > On Sat, Nov 02, 2024 at 09:53:58AM -0700, Ian Rogers wrote:
> > > Add an accessor function for tp_format. Rather than search+replace
> > > uses try to use a variable and reuse it. Add additional NULL checks
> > > when accessing/using the value. Make sure the PTR_ERR is nulled out on
> > > error path in evsel__newtp_idx.
> > > Signed-off-by: Ian Rogers <irogers@google.com>
> > > +++ b/tools/perf/builtin-kmem.c
> > > @@ -772,8 +773,9 @@ static int parse_gfp_flags(struct evsel *evsel, struct perf_sample *sample,
> > > }
> > >
> > > trace_seq_init(&seq);
> > > - tep_print_event(evsel->tp_format->tep,
> > > - &seq, &record, "%s", TEP_PRINT_INFO);
> > > + tp_format = evsel__tp_format(evsel);
> > > + if (tp_format)
> > > + tep_print_event(tp_format->tep, &seq, &record, "%s", TEP_PRINT_INFO);
> > >
> > > str = strtok_r(seq.buffer, " ", &pos);
> > > while (str) {
> > > @@ -2011,14 +2013,15 @@ int cmd_kmem(int argc, const char **argv)
> > > }
> > >
> > > if (kmem_page) {
> > > - struct evsel *evsel = evlist__find_tracepoint_by_name(session->evlist, "kmem:mm_page_alloc");
> > > + struct evsel *evsel = evlist__find_tracepoint_by_name(session->evlist,
> > > + "kmem:mm_page_alloc");
> >
> > Try to avoid these reflows to reduce patch size, please.
>
> Agreed, in this case check `checkpatch.pl` is complaining that the
> line length is 109 columns.
Ok, but it was like that before, your patch is not touching that line
for some other reason, so it is unrelated to what you're doing, causing
a distraction.
Besides, even the documentation for checkpatch mentions that that is:
**LONG_LINE**
The line has exceeded the specified maximum length.
To use a different maximum line length, the --max-line-length=n option
may be added while invoking checkpatch.
Earlier, the default line length was 80 columns. Commit bdc48fa11e46
("checkpatch/coding-style: deprecate 80-column warning") increased the
limit to 100 columns. This is not a hard limit either and it's
preferable to stay within 80 columns whenever possible.
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings
----------------
So if it was there already, meaning the original author preferred it
that way, its not touched by the feature that is being worked on in this
patch, ends up being an extra hunk, just reflowing, a distraction.
- Arnaldo
next prev parent reply other threads:[~2024-11-05 19:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-02 16:53 [PATCH v2 0/6] Avoid parsing tracepoint format just for id Ian Rogers
2024-11-02 16:53 ` [PATCH v2 1/6] tool api fs: Correctly encode errno for read/write open failures Ian Rogers
2024-11-05 17:18 ` Arnaldo Carvalho de Melo
2024-11-02 16:53 ` [PATCH v2 2/6] perf trace-event: Constify print arguments Ian Rogers
2024-11-05 17:18 ` Arnaldo Carvalho de Melo
2024-11-02 16:53 ` [PATCH v2 3/6] perf trace-event: Always build trace-event-info.c Ian Rogers
2024-11-05 17:22 ` Arnaldo Carvalho de Melo
2024-11-02 16:53 ` [PATCH v2 4/6] perf evsel: Add/use accessor for tp_format Ian Rogers
2024-11-05 17:36 ` Arnaldo Carvalho de Melo
2024-11-05 19:33 ` Ian Rogers
2024-11-05 19:52 ` Arnaldo Carvalho de Melo [this message]
2024-11-05 21:04 ` Ian Rogers
2024-11-02 16:53 ` [PATCH v2 5/6] perf evsel: Allow evsel__newtp without libtraceevent Ian Rogers
2024-11-05 17:45 ` Arnaldo Carvalho de Melo
2024-11-02 16:54 ` [PATCH v2 6/6] perf tests: Enable tests disabled due to tracepoint parsing Ian Rogers
2024-11-05 17:47 ` Arnaldo Carvalho de Melo
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=Zyp3jeLz4ympxfHv@x1 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=asmadeus@codewreck.org \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=ben.gainey@arm.com \
--cc=colin.i.king@gmail.com \
--cc=fzczx123@gmail.com \
--cc=ilkka@os.amperecomputing.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=p4ranlee@gmail.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sesse@google.com \
--cc=thomas.falcon@intel.com \
--cc=weilin.wang@intel.com \
--cc=yang.lee@linux.alibaba.com \
--cc=yangjihong@bytedance.com \
--cc=zegao2021@gmail.com \
--cc=zhaimingbing@cmss.chinamobile.com \
/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).