2023-10-31 02:46:31

by renhai_lenovo

[permalink] [raw]
Subject: Update objtrace usage in Documentation/trace/events.rst

Documentation: trace/objtrace: Move the line entering the trace
directory to the first step, so that the commands in the first step
can be executed smoothly.

Signed-off-by: Renhai <[email protected]>

diff --git a/Documentation/trace/events.rst b/Documentation/trace/events.rst
index 52ac8ca8ab64..d5fadf7966de 100644
--- a/Documentation/trace/events.rst
+++ b/Documentation/trace/events.rst
@@ -583,6 +583,7 @@ The following commands are supported:

.. code-block::

+ # cd /sys/kernel/debug/tracing/
# echo 'p bio_add_page arg1=$arg1' > ./kprobe_events

Secondly, we can get the value dynamically based on the object:
@@ -597,7 +598,6 @@ The following commands are supported:
# echo 'objtrace:add:arg1,0x28:u32:1 if comm == "cat"' >
./events/kprobes/ \
p_bio_add_page_0/trigger

- # cd /sys/kernel/debug/tracing/
# echo 'p bio_add_page arg1=$arg1' > ./kprobe_events
# echo 'objtrace:add:arg1,0x28:u32:1 if comm == "cat"' >
./events/kprobes/p_bio_add_page_0/trigger


2023-10-31 03:06:56

by Jeff Xie

[permalink] [raw]
Subject: Re: Update objtrace usage in Documentation/trace/events.rst

Hi renhai,

On Tue, Oct 31, 2023 at 10:46 AM renhai_lenovo <[email protected]> wrote:
>
> Documentation: trace/objtrace: Move the line entering the trace
> directory to the first step, so that the commands in the first step
> can be executed smoothly.
>
> Signed-off-by: Renhai <[email protected]>
>
> diff --git a/Documentation/trace/events.rst b/Documentation/trace/events.rst
> index 52ac8ca8ab64..d5fadf7966de 100644
> --- a/Documentation/trace/events.rst
> +++ b/Documentation/trace/events.rst
> @@ -583,6 +583,7 @@ The following commands are supported:
>
> .. code-block::
>
> + # cd /sys/kernel/debug/tracing/
> # echo 'p bio_add_page arg1=$arg1' > ./kprobe_events
>
> Secondly, we can get the value dynamically based on the object:
> @@ -597,7 +598,6 @@ The following commands are supported:
> # echo 'objtrace:add:arg1,0x28:u32:1 if comm == "cat"' >
> ./events/kprobes/ \
> p_bio_add_page_0/trigger
>
> - # cd /sys/kernel/debug/tracing/
> # echo 'p bio_add_page arg1=$arg1' > ./kprobe_events
> # echo 'objtrace:add:arg1,0x28:u32:1 if comm == "cat"' >
> ./events/kprobes/p_bio_add_page_0/trigger

Thank you for your interest in the objtrace function. I am currently
busy with other things.
I will come back soon to update this function. When I update it, I
will add your suggestions.

--
Thanks,
JeffXie