public inbox for linux-sparse@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Ben Dooks <ben.dooks@codethink.co.uk>
Cc: linux-sparse@vger.kernel.org
Subject: Re: req: option to show area warning is from
Date: Wed, 7 Jan 2026 22:40:32 +0300	[thread overview]
Message-ID: <aV62sDxNla12F1V4@stanley.mountain> (raw)
In-Reply-To: <944a3c73-f971-441c-8ba6-344f1ac099f3@codethink.co.uk>

On Wed, Jan 07, 2026 at 02:58:44PM +0000, Ben Dooks wrote:
> I think it would be useful to have an option to show a more detailed
> view of which part of the source generated a warning. Would this be
> possible and if so is there anyone interested in doing it?
> 
> I'm looking at the following warning:
> ./include/trace/events/xdp.h:304:1: warning: Using plain integer as NULL
> pointer
> 
> And the kernel source from the pre-processed file looks like this:
> 
> > static __attribute__((no_instrument_function)) void do_perf_trace_mem_disconnect(void *__data, const struct xdp_mem_allocator *xa) { struct trace_event_call *event_call = __data; struct trace_event_data_offsets_mem_disconnect __attribute__((__unused__)) __data_offsets; struct trace_event_raw_mem_disconnect *entry; struct pt_regs *__regs; u64 __count = 1; struct task_struct *__task = ((void *)0); struct hlist_head *head; int __entry_size; int __data_size; int rctx; __data_size = trace_event_get_offsets_mem_disconnect(&__data_offsets, xa); head = ({ do { const void __seg_gs *__vpp_verify = (typeof((event_call->perf_events) + 0))((void *)0); (void)__vpp_verify; } while (0); ({ unsigned long tcp_ptr__ = ({ *( typeof(this_cpu_off) *)(&(this_cpu_off)); }); tcp_ptr__ += ( unsigned long)(event_call->perf_events); (__typeof_unqual__(*(event_call->perf_events)) *)tcp_ptr__; }); }); if (!bpf_prog_array_valid(event_call) && __builtin_constant_p(!__task) && !__task && hlist_empty(head)) return; __entry_size = ((((__data_size + sizeof(*entry) + sizeof(u32))) + ((__typeof__((__data_size + sizeof(*entry) + sizeof(u32))))((sizeof(u64))) - 1)) & ~((__typeof__((__data_size + sizeof(*entry) + sizeof(u32))))((sizeof(u64))) - 1)); __entry_size -= sizeof(u32); entry = perf_trace_buf_alloc(__entry_size, &__regs, &rctx); if (!entry) return; perf_fetch_caller_regs(__regs); { entry->xa = xa; entry->mem_id = xa->mem.id; entry->mem_type = xa->mem.type; entry->allocator = xa->allocator;; } perf_trace_run_bpf_submit(entry, __entry_size, rctx, event_call, __count, __regs, head, __task); } static __attribute__((no_instrument_function)) void perf_trace_mem_disconnect(void *__data, const struct xdp_mem_allocator *xa) { u64 __count __attribute__((unused)); struct task_struct *__task __attribute__((unused)); do_perf_trace_mem_disconnect(__data, xa); }; static inline __attribute__((__gnu_inline__)) __attribute__((__unused__)) __attribute__((no_instrument_function)) void perf_test_probe_mem_disconnect(void) { check_trace_callback_type_mem_disconnect(perf_trace_mem_disconnect); };
> 
> 
> This is obviously a lot to go through and very difficult to read.
> 
> It would be great if we could get a dump of what was going on.

Yeah, I spend a lot of time adding newlines to pre-processed code.  Is
there a good script to re-indent .i files?

regards,
dan carpenter

      reply	other threads:[~2026-01-07 19:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07 14:58 req: option to show area warning is from Ben Dooks
2026-01-07 19:40 ` Dan Carpenter [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=aV62sDxNla12F1V4@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=ben.dooks@codethink.co.uk \
    --cc=linux-sparse@vger.kernel.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