From: Linyu Yuan <quic_linyyuan@quicinc.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
<linux-kernel@vger.kernel.org>, <bpf@vger.kernel.org>
Subject: Re: [PATCH v4 1/2] trace: add new file under include/trace/stages/ for perf/bpf
Date: Mon, 30 Jan 2023 11:12:20 +0800 [thread overview]
Message-ID: <b130c320-33b8-4d7f-b718-7328f4e79569@quicinc.com> (raw)
In-Reply-To: <20230124144611.3476ad36@gandalf.local.home>
On 1/25/2023 3:46 AM, Steven Rostedt wrote:
> On Fri, 16 Dec 2022 17:03:04 +0800
> Linyu Yuan <quic_linyyuan@quicinc.com> wrote:
>
>> when experiment change for trace operation, the files under
>> include/trace/stages/ will be changed, perf/bpf trace may compile fail.
> Sorry for the late reply, I was expecting some feedback from the perf
> and/or BPF folks.
>
>> add new file stage8_perf_call.h and stage9_bpf_call.h under
>> include/trace/stages/, it will make sure no missing change when expriment.
>>
> Actually, these are not part of the stage sequence. In fact they could
thanks for explanation.
> possibly be replaced *with* the stage sequences (which I think I'll apply):
>
> For example:
>
> diff --git a/include/trace/bpf_probe.h b/include/trace/bpf_probe.h
> index 155c495b89ea..1f7fc1fc590c 100644
> --- a/include/trace/bpf_probe.h
> +++ b/include/trace/bpf_probe.h
> @@ -4,50 +4,7 @@
>
> #ifdef CONFIG_BPF_EVENTS
>
> -#undef __entry
> -#define __entry entry
> -
> -#undef __get_dynamic_array
> -#define __get_dynamic_array(field) \
> - ((void *)__entry + (__entry->__data_loc_##field & 0xffff))
> -
> -#undef __get_dynamic_array_len
> -#define __get_dynamic_array_len(field) \
> - ((__entry->__data_loc_##field >> 16) & 0xffff)
> -
> -#undef __get_str
> -#define __get_str(field) ((char *)__get_dynamic_array(field))
> -
> -#undef __get_bitmask
> -#define __get_bitmask(field) (char *)__get_dynamic_array(field)
> -
> -#undef __get_cpumask
> -#define __get_cpumask(field) (char *)__get_dynamic_array(field)
> -
> -#undef __get_sockaddr
> -#define __get_sockaddr(field) ((struct sockaddr *)__get_dynamic_array(field))
> -
> -#undef __get_rel_dynamic_array
> -#define __get_rel_dynamic_array(field) \
> - ((void *)(&__entry->__rel_loc_##field) + \
> - sizeof(__entry->__rel_loc_##field) + \
> - (__entry->__rel_loc_##field & 0xffff))
> -
> -#undef __get_rel_dynamic_array_len
> -#define __get_rel_dynamic_array_len(field) \
> - ((__entry->__rel_loc_##field >> 16) & 0xffff)
> -
> -#undef __get_rel_str
> -#define __get_rel_str(field) ((char *)__get_rel_dynamic_array(field))
> -
> -#undef __get_rel_bitmask
> -#define __get_rel_bitmask(field) (char *)__get_rel_dynamic_array(field)
> -
> -#undef __get_rel_cpumask
> -#define __get_rel_cpumask(field) (char *)__get_rel_dynamic_array(field)
> -
> -#undef __get_rel_sockaddr
> -#define __get_rel_sockaddr(field) ((struct sockaddr *)__get_rel_dynamic_array(field))
> +#include "stages/stage6_event_callback.h"
>
> #undef __perf_count
> #define __perf_count(c) (c)
> diff --git a/include/trace/perf.h b/include/trace/perf.h
> index 8f3bf1e17707..2c11181c82e0 100644
> --- a/include/trace/perf.h
> +++ b/include/trace/perf.h
> @@ -4,51 +4,7 @@
>
> #ifdef CONFIG_PERF_EVENTS
>
> -#undef __entry
> -#define __entry entry
> -
> -#undef __get_dynamic_array
> -#define __get_dynamic_array(field) \
> - ((void *)__entry + (__entry->__data_loc_##field & 0xffff))
> -
> -#undef __get_dynamic_array_len
> -#define __get_dynamic_array_len(field) \
> - ((__entry->__data_loc_##field >> 16) & 0xffff)
> -
> -#undef __get_str
> -#define __get_str(field) ((char *)__get_dynamic_array(field))
> -
> -#undef __get_bitmask
> -#define __get_bitmask(field) (char *)__get_dynamic_array(field)
> -
> -#undef __get_cpumask
> -#define __get_cpumask(field) (char *)__get_dynamic_array(field)
> -
> -#undef __get_sockaddr
> -#define __get_sockaddr(field) ((struct sockaddr *)__get_dynamic_array(field))
> -
> -#undef __get_rel_dynamic_array
> -#define __get_rel_dynamic_array(field) \
> - ((void *)__entry + \
> - offsetof(typeof(*__entry), __rel_loc_##field) + \
> - sizeof(__entry->__rel_loc_##field) + \
> - (__entry->__rel_loc_##field & 0xffff))
> -
> -#undef __get_rel_dynamic_array_len
> -#define __get_rel_dynamic_array_len(field) \
> - ((__entry->__rel_loc_##field >> 16) & 0xffff)
> -
> -#undef __get_rel_str
> -#define __get_rel_str(field) ((char *)__get_rel_dynamic_array(field))
> -
> -#undef __get_rel_bitmask
> -#define __get_rel_bitmask(field) (char *)__get_rel_dynamic_array(field)
> -
> -#undef __get_rel_cpumask
> -#define __get_rel_cpumask(field) (char *)__get_rel_dynamic_array(field)
> -
> -#undef __get_rel_sockaddr
> -#define __get_rel_sockaddr(field) ((struct sockaddr *)__get_rel_dynamic_array(field))
> +#include "stages/stage6_event_callback.h"
>
> #undef __perf_count
> #define __perf_count(c) (__count = (c))
> diff --git a/include/trace/stages/stage6_event_callback.h b/include/trace/stages/stage6_event_callback.h
> index 49c32394b53f..919b1a4da980 100644
> --- a/include/trace/stages/stage6_event_callback.h
> +++ b/include/trace/stages/stage6_event_callback.h
> @@ -2,6 +2,9 @@
>
> /* Stage 6 definitions for creating trace events */
>
> +/* Reuse some of the stage 3 macros */
> +#include "stage3_trace_output.h"
> +
> #undef __entry
> #define __entry entry
>
prev parent reply other threads:[~2023-01-30 3:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 9:03 Linyu Yuan
2022-12-16 9:03 ` [PATCH v4 2/2] trace: acquire buffer from temparary trace sequence Linyu Yuan
2023-01-24 21:44 ` Steven Rostedt
2023-01-24 19:46 ` [PATCH v4 1/2] trace: add new file under include/trace/stages/ for perf/bpf Steven Rostedt
2023-01-30 3:12 ` Linyu Yuan [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=b130c320-33b8-4d7f-b718-7328f4e79569@quicinc.com \
--to=quic_linyyuan@quicinc.com \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®