Re: [PATCH v3 1/2] perf trace: Correct default cpumask formatting to hexadecimal
From: Aaron Tomlin
Date: Mon Jul 20 2026 - 13:05:31 EST
On Sun, Jul 19, 2026 at 10:02:52PM -0700, Namhyung Kim wrote:
> Hello,
Hi Namhyung,
[ ... ]
> > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> > index ba0f8749fc7d..f8b8431f9543 100644
> > --- a/tools/perf/builtin-trace.c
> > +++ b/tools/perf/builtin-trace.c
> > @@ -3207,6 +3207,21 @@ static void bpf_output__fprintf(struct trace *trace,
> > ++trace->nr_events_printed;
> > }
> >
> > +static unsigned char bitmap_byte(const unsigned long *mask, int byte_idx)
> > +{
> > + unsigned char b_val = 0;
> > + int bit_in_byte;
> > +
> > + for (bit_in_byte = 0; bit_in_byte < 8; bit_in_byte++) {
> > + int b_idx = byte_idx * 8 + bit_in_byte;
> > + int host_w_idx = b_idx / BITS_PER_LONG;
> > + int host_bit_in_word = b_idx % BITS_PER_LONG;
>
> Better to add a blank line.
Acknowledged.
> > + env = evsel__env(sample->evsel);
> > + target_is_64 = env ? perf_env__kernel_is_64_bit(env) : (sizeof(void *) == 8);
> > + target_word_size = target_is_64 ? 8 : 4;
> > + nr_words = len / target_word_size;
> > +
> > + for (bit_idx = 0; bit_idx < nbits; bit_idx++) {
> > + int w_idx = bit_idx / (target_word_size * 8);
> > + int bit_in_word = bit_idx % (target_word_size * 8);
> > + bool set = false;
> > +
> > + if (w_idx < nr_words) {
>
> Nit: Can you change it to something like below to reduce indentation?
>
> if (w_idx >= nr_words)
> break;
Acknowledged.
Kind regards,
--
Aaron Tomlin