* [PATCH 0/5] perf: Fix few nitpicks in perf-script
@ 2017-05-30 11:18 SeongJae Park
2017-05-30 11:18 ` [PATCH 1/5] perf script: Fix outdated comment for perf-trace-python SeongJae Park
` (5 more replies)
0 siblings, 6 replies; 17+ messages in thread
From: SeongJae Park @ 2017-05-30 11:18 UTC (permalink / raw)
To: peterz, mingo, acme, alexander.shishkin; +Cc: linux-kernel, SeongJae Park
This patchset fixes few nitpicks in perf-script code and documents.
SeongJae Park (5):
perf script: Fix outdated comment for perf-trace-python
perf-script-python,perl.txt: Fix typos
perf-script-python.txt: Polish command examples
perf-script-python.txt: Fix wrong code snippets
perf-script-python.txt: Apply updated trace_unhandled() definition
tools/perf/Documentation/perf-script-perl.txt | 2 +-
tools/perf/Documentation/perf-script-python.txt | 23 +++++++++-------------
.../util/scripting-engines/trace-event-python.c | 2 +-
3 files changed, 11 insertions(+), 16 deletions(-)
--
2.13.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/5] perf script: Fix outdated comment for perf-trace-python
2017-05-30 11:18 [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
@ 2017-05-30 11:18 ` SeongJae Park
2017-06-07 23:19 ` Arnaldo Carvalho de Melo
2017-06-08 22:46 ` [tip:perf/urgent] " tip-bot for SeongJae Park
2017-05-30 11:18 ` [PATCH 2/5] perf-script-python,perl.txt: Fix typos SeongJae Park
` (4 subsequent siblings)
5 siblings, 2 replies; 17+ messages in thread
From: SeongJae Park @ 2017-05-30 11:18 UTC (permalink / raw)
To: peterz, mingo, acme, alexander.shishkin; +Cc: linux-kernel, SeongJae Park
Script that generated by '--gen-script' option contains an outdated
comment. It mentions about 'perf-trace-python' document while it has
renamed to 'perf-script-python'. This commit fixes the outdated
comment.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Fixes: 133dc4c39c57 ("perf: Rename 'perf trace' to 'perf script'")
---
tools/perf/util/scripting-engines/trace-event-python.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 9d92af7d0718..40de3cb40d21 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -1219,7 +1219,7 @@ static int python_generate_script(struct pevent *pevent, const char *outfile)
fprintf(ofp, "# be retrieved using Python functions of the form "
"common_*(context).\n");
- fprintf(ofp, "# See the perf-trace-python Documentation for the list "
+ fprintf(ofp, "# See the perf-script-python Documentation for the list "
"of available functions.\n\n");
fprintf(ofp, "import os\n");
--
2.13.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/5] perf-script-python,perl.txt: Fix typos
2017-05-30 11:18 [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
2017-05-30 11:18 ` [PATCH 1/5] perf script: Fix outdated comment for perf-trace-python SeongJae Park
@ 2017-05-30 11:18 ` SeongJae Park
2017-06-07 23:19 ` Arnaldo Carvalho de Melo
2017-06-08 22:47 ` [tip:perf/urgent] perf script: Fix documentation errors tip-bot for SeongJae Park
2017-05-30 11:18 ` [PATCH 3/5] perf-script-python.txt: Polish command examples SeongJae Park
` (3 subsequent siblings)
5 siblings, 2 replies; 17+ messages in thread
From: SeongJae Park @ 2017-05-30 11:18 UTC (permalink / raw)
To: peterz, mingo, acme, alexander.shishkin; +Cc: linux-kernel, SeongJae Park
This commit fixes two typos in documents for perf-script-python and
perf-script-perl as below:
- /sys/kernel/debug/tracing events -> /sys/kernel/debug/tracing/events/
- trace_handled -> trace_unhandled
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation")
---
tools/perf/Documentation/perf-script-perl.txt | 2 +-
tools/perf/Documentation/perf-script-python.txt | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/Documentation/perf-script-perl.txt b/tools/perf/Documentation/perf-script-perl.txt
index dfbb506d2c34..142606c0ec9c 100644
--- a/tools/perf/Documentation/perf-script-perl.txt
+++ b/tools/perf/Documentation/perf-script-perl.txt
@@ -39,7 +39,7 @@ EVENT HANDLERS
When perf script is invoked using a trace script, a user-defined
'handler function' is called for each event in the trace. If there's
no handler function defined for a given event type, the event is
-ignored (or passed to a 'trace_handled' function, see below) and the
+ignored (or passed to a 'trace_unhandled' function, see below) and the
next event is processed.
Most of the event's field values are passed as arguments to the
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
index 54acba221558..087b87c956ba 100644
--- a/tools/perf/Documentation/perf-script-python.txt
+++ b/tools/perf/Documentation/perf-script-python.txt
@@ -321,7 +321,7 @@ So those are the essential steps in writing and running a script. The
process can be generalized to any tracepoint or set of tracepoints
you're interested in - basically find the tracepoint(s) you're
interested in by looking at the list of available events shown by
-'perf list' and/or look in /sys/kernel/debug/tracing events for
+'perf list' and/or look in /sys/kernel/debug/tracing/events/ for
detailed event and field info, record the corresponding trace data
using 'perf record', passing it the list of interesting events,
generate a skeleton script using 'perf script -g python' and modify the
@@ -437,7 +437,7 @@ EVENT HANDLERS
When perf script is invoked using a trace script, a user-defined
'handler function' is called for each event in the trace. If there's
no handler function defined for a given event type, the event is
-ignored (or passed to a 'trace_handled' function, see below) and the
+ignored (or passed to a 'trace_unhandled' function, see below) and the
next event is processed.
Most of the event's field values are passed as arguments to the
--
2.13.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/5] perf-script-python.txt: Polish command examples
2017-05-30 11:18 [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
2017-05-30 11:18 ` [PATCH 1/5] perf script: Fix outdated comment for perf-trace-python SeongJae Park
2017-05-30 11:18 ` [PATCH 2/5] perf-script-python,perl.txt: Fix typos SeongJae Park
@ 2017-05-30 11:18 ` SeongJae Park
2017-06-08 22:49 ` [tip:perf/urgent] perf script python: Remove dups in documentation examples tip-bot for SeongJae Park
2017-05-30 11:18 ` [PATCH 4/5] perf-script-python.txt: Fix wrong code snippets SeongJae Park
` (2 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: SeongJae Park @ 2017-05-30 11:18 UTC (permalink / raw)
To: peterz, mingo, acme, alexander.shishkin; +Cc: linux-kernel, SeongJae Park
Few shell command examples in perf-script-python.txt has few nitpicks
include:
- tools/perf/scripts/python directory listing command is unnecessarily
repeated.
- few examples contain additional information in command prompt
unnecessarily and inconsistently.
This commit fixes them to enhance readability of the document.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation")
---
tools/perf/Documentation/perf-script-python.txt | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
index 087b87c956ba..44e51351536f 100644
--- a/tools/perf/Documentation/perf-script-python.txt
+++ b/tools/perf/Documentation/perf-script-python.txt
@@ -334,7 +334,7 @@ right place, you can have your script listed alongside the other
scripts listed by the 'perf script -l' command e.g.:
----
-root@tropicana:~# perf script -l
+# perf script -l
List of available trace scripts:
wakeup-latency system-wide min/max/avg wakeup latency
rw-by-file <comm> r/w activity for a program, by file
@@ -383,8 +383,6 @@ source tree:
----
# ls -al kernel-source/tools/perf/scripts/python
-
-root@tropicana:/home/trz/src/tip# ls -al tools/perf/scripts/python
total 32
drwxr-xr-x 4 trz trz 4096 2010-01-26 22:30 .
drwxr-xr-x 4 trz trz 4096 2010-01-26 22:29 ..
@@ -399,7 +397,7 @@ otherwise your script won't show up at run-time), 'perf script -l'
should show a new entry for your script:
----
-root@tropicana:~# perf script -l
+# perf script -l
List of available trace scripts:
wakeup-latency system-wide min/max/avg wakeup latency
rw-by-file <comm> r/w activity for a program, by file
--
2.13.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/5] perf-script-python.txt: Fix wrong code snippets
2017-05-30 11:18 [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
` (2 preceding siblings ...)
2017-05-30 11:18 ` [PATCH 3/5] perf-script-python.txt: Polish command examples SeongJae Park
@ 2017-05-30 11:18 ` SeongJae Park
2017-06-07 23:35 ` Arnaldo Carvalho de Melo
2017-06-08 22:47 ` [tip:perf/urgent] perf script python: Fix wrong code snippets in documentation tip-bot for SeongJae Park
2017-05-30 11:18 ` [PATCH 5/5] perf-script-python.txt: Apply updated trace_unhandled() definition SeongJae Park
2017-06-07 22:42 ` [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
5 siblings, 2 replies; 17+ messages in thread
From: SeongJae Park @ 2017-05-30 11:18 UTC (permalink / raw)
To: peterz, mingo, acme, alexander.shishkin; +Cc: linux-kernel, SeongJae Park
This commit fixes wrong code snippets for trace_begin() and trace_end()
function example definition.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
tools/perf/Documentation/perf-script-python.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
index 44e51351536f..f723ce41268c 100644
--- a/tools/perf/Documentation/perf-script-python.txt
+++ b/tools/perf/Documentation/perf-script-python.txt
@@ -530,7 +530,7 @@ can implement a set of optional functions:
gives scripts a chance to do setup tasks:
----
-def trace_begin:
+def trace_begin():
pass
----
@@ -539,7 +539,7 @@ def trace_begin:
as display results:
----
-def trace_end:
+def trace_end():
pass
----
--
2.13.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/5] perf-script-python.txt: Apply updated trace_unhandled() definition
2017-05-30 11:18 [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
` (3 preceding siblings ...)
2017-05-30 11:18 ` [PATCH 4/5] perf-script-python.txt: Fix wrong code snippets SeongJae Park
@ 2017-05-30 11:18 ` SeongJae Park
2017-06-07 23:27 ` Arnaldo Carvalho de Melo
2017-06-08 22:48 ` [tip:perf/urgent] perf script python: Updated trace_unhandled() signature tip-bot for SeongJae Park
2017-06-07 22:42 ` [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
5 siblings, 2 replies; 17+ messages in thread
From: SeongJae Park @ 2017-05-30 11:18 UTC (permalink / raw)
To: peterz, mingo, acme, alexander.shishkin; +Cc: linux-kernel, SeongJae Park
Default definition of trace_unhandled() has updated while
perf-script-python.txt has not updated. This commit updates the
document for that.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Fixes: c02514850d67b ("perf scripts python: Give field dict to unhandled callback")
---
tools/perf/Documentation/perf-script-python.txt | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
index f723ce41268c..51ec2d20068a 100644
--- a/tools/perf/Documentation/perf-script-python.txt
+++ b/tools/perf/Documentation/perf-script-python.txt
@@ -149,10 +149,8 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,
print "id=%d, args=%s\n" % \
(id, args),
-def trace_unhandled(event_name, context, common_cpu, common_secs, common_nsecs,
- common_pid, common_comm):
- print_header(event_name, common_cpu, common_secs, common_nsecs,
- common_pid, common_comm)
+def trace_unhandled(event_name, context, event_fields_dict):
+ print ' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())])
def print_header(event_name, cpu, secs, nsecs, pid, comm):
print "%-20s %5u %05u.%09u %8u %-20s " % \
@@ -548,8 +546,7 @@ def trace_end():
of common arguments are passed into it:
----
-def trace_unhandled(event_name, context, common_cpu, common_secs,
- common_nsecs, common_pid, common_comm):
+def trace_unhandled(event_name, context, event_fields_dict):
pass
----
--
2.13.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 0/5] perf: Fix few nitpicks in perf-script
2017-05-30 11:18 [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
` (4 preceding siblings ...)
2017-05-30 11:18 ` [PATCH 5/5] perf-script-python.txt: Apply updated trace_unhandled() definition SeongJae Park
@ 2017-06-07 22:42 ` SeongJae Park
5 siblings, 0 replies; 17+ messages in thread
From: SeongJae Park @ 2017-06-07 22:42 UTC (permalink / raw)
To: SeongJae Park
Cc: peterz, mhiramat, arnaldo.melo, mingo, acme, alexander.shishkin,
linux-kernel
Hi, may I ask some comments?
On Tue, 30 May 2017, SeongJae Park wrote:
> This patchset fixes few nitpicks in perf-script code and documents.
>
> SeongJae Park (5):
> perf script: Fix outdated comment for perf-trace-python
> perf-script-python,perl.txt: Fix typos
> perf-script-python.txt: Polish command examples
> perf-script-python.txt: Fix wrong code snippets
> perf-script-python.txt: Apply updated trace_unhandled() definition
>
> tools/perf/Documentation/perf-script-perl.txt | 2 +-
> tools/perf/Documentation/perf-script-python.txt | 23 +++++++++-------------
> .../util/scripting-engines/trace-event-python.c | 2 +-
> 3 files changed, 11 insertions(+), 16 deletions(-)
>
> --
> 2.13.0
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/5] perf script: Fix outdated comment for perf-trace-python
2017-05-30 11:18 ` [PATCH 1/5] perf script: Fix outdated comment for perf-trace-python SeongJae Park
@ 2017-06-07 23:19 ` Arnaldo Carvalho de Melo
2017-06-08 22:46 ` [tip:perf/urgent] " tip-bot for SeongJae Park
1 sibling, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-06-07 23:19 UTC (permalink / raw)
To: SeongJae Park; +Cc: peterz, mingo, alexander.shishkin, linux-kernel
Em Tue, May 30, 2017 at 08:18:23PM +0900, SeongJae Park escreveu:
> Script that generated by '--gen-script' option contains an outdated
> comment. It mentions about 'perf-trace-python' document while it has
> renamed to 'perf-script-python'. This commit fixes the outdated
> comment.
Thanks, applied to perf/urgent.
- Arnaldo
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
> Fixes: 133dc4c39c57 ("perf: Rename 'perf trace' to 'perf script'")
> ---
> tools/perf/util/scripting-engines/trace-event-python.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
> index 9d92af7d0718..40de3cb40d21 100644
> --- a/tools/perf/util/scripting-engines/trace-event-python.c
> +++ b/tools/perf/util/scripting-engines/trace-event-python.c
> @@ -1219,7 +1219,7 @@ static int python_generate_script(struct pevent *pevent, const char *outfile)
> fprintf(ofp, "# be retrieved using Python functions of the form "
> "common_*(context).\n");
>
> - fprintf(ofp, "# See the perf-trace-python Documentation for the list "
> + fprintf(ofp, "# See the perf-script-python Documentation for the list "
> "of available functions.\n\n");
>
> fprintf(ofp, "import os\n");
> --
> 2.13.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/5] perf-script-python,perl.txt: Fix typos
2017-05-30 11:18 ` [PATCH 2/5] perf-script-python,perl.txt: Fix typos SeongJae Park
@ 2017-06-07 23:19 ` Arnaldo Carvalho de Melo
2017-06-08 22:47 ` [tip:perf/urgent] perf script: Fix documentation errors tip-bot for SeongJae Park
1 sibling, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-06-07 23:19 UTC (permalink / raw)
To: SeongJae Park; +Cc: peterz, mingo, alexander.shishkin, linux-kernel
Em Tue, May 30, 2017 at 08:18:24PM +0900, SeongJae Park escreveu:
> This commit fixes two typos in documents for perf-script-python and
> perf-script-perl as below:
>
> - /sys/kernel/debug/tracing events -> /sys/kernel/debug/tracing/events/
> - trace_handled -> trace_unhandled
Thanks, applied to perf/urgent.
- Arnaldo
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
> Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation")
> ---
> tools/perf/Documentation/perf-script-perl.txt | 2 +-
> tools/perf/Documentation/perf-script-python.txt | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/Documentation/perf-script-perl.txt b/tools/perf/Documentation/perf-script-perl.txt
> index dfbb506d2c34..142606c0ec9c 100644
> --- a/tools/perf/Documentation/perf-script-perl.txt
> +++ b/tools/perf/Documentation/perf-script-perl.txt
> @@ -39,7 +39,7 @@ EVENT HANDLERS
> When perf script is invoked using a trace script, a user-defined
> 'handler function' is called for each event in the trace. If there's
> no handler function defined for a given event type, the event is
> -ignored (or passed to a 'trace_handled' function, see below) and the
> +ignored (or passed to a 'trace_unhandled' function, see below) and the
> next event is processed.
>
> Most of the event's field values are passed as arguments to the
> diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
> index 54acba221558..087b87c956ba 100644
> --- a/tools/perf/Documentation/perf-script-python.txt
> +++ b/tools/perf/Documentation/perf-script-python.txt
> @@ -321,7 +321,7 @@ So those are the essential steps in writing and running a script. The
> process can be generalized to any tracepoint or set of tracepoints
> you're interested in - basically find the tracepoint(s) you're
> interested in by looking at the list of available events shown by
> -'perf list' and/or look in /sys/kernel/debug/tracing events for
> +'perf list' and/or look in /sys/kernel/debug/tracing/events/ for
> detailed event and field info, record the corresponding trace data
> using 'perf record', passing it the list of interesting events,
> generate a skeleton script using 'perf script -g python' and modify the
> @@ -437,7 +437,7 @@ EVENT HANDLERS
> When perf script is invoked using a trace script, a user-defined
> 'handler function' is called for each event in the trace. If there's
> no handler function defined for a given event type, the event is
> -ignored (or passed to a 'trace_handled' function, see below) and the
> +ignored (or passed to a 'trace_unhandled' function, see below) and the
> next event is processed.
>
> Most of the event's field values are passed as arguments to the
> --
> 2.13.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 5/5] perf-script-python.txt: Apply updated trace_unhandled() definition
2017-05-30 11:18 ` [PATCH 5/5] perf-script-python.txt: Apply updated trace_unhandled() definition SeongJae Park
@ 2017-06-07 23:27 ` Arnaldo Carvalho de Melo
2017-06-08 22:48 ` [tip:perf/urgent] perf script python: Updated trace_unhandled() signature tip-bot for SeongJae Park
1 sibling, 0 replies; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-06-07 23:27 UTC (permalink / raw)
To: SeongJae Park; +Cc: peterz, mingo, alexander.shishkin, linux-kernel
Em Tue, May 30, 2017 at 08:18:27PM +0900, SeongJae Park escreveu:
> Default definition of trace_unhandled() has updated while
> perf-script-python.txt has not updated. This commit updates the
> document for that.
Thanks, applied to perf/urgent.
- Arnaldo
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
> Fixes: c02514850d67b ("perf scripts python: Give field dict to unhandled callback")
> ---
> tools/perf/Documentation/perf-script-python.txt | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
> index f723ce41268c..51ec2d20068a 100644
> --- a/tools/perf/Documentation/perf-script-python.txt
> +++ b/tools/perf/Documentation/perf-script-python.txt
> @@ -149,10 +149,8 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,
> print "id=%d, args=%s\n" % \
> (id, args),
>
> -def trace_unhandled(event_name, context, common_cpu, common_secs, common_nsecs,
> - common_pid, common_comm):
> - print_header(event_name, common_cpu, common_secs, common_nsecs,
> - common_pid, common_comm)
> +def trace_unhandled(event_name, context, event_fields_dict):
> + print ' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())])
>
> def print_header(event_name, cpu, secs, nsecs, pid, comm):
> print "%-20s %5u %05u.%09u %8u %-20s " % \
> @@ -548,8 +546,7 @@ def trace_end():
> of common arguments are passed into it:
>
> ----
> -def trace_unhandled(event_name, context, common_cpu, common_secs,
> - common_nsecs, common_pid, common_comm):
> +def trace_unhandled(event_name, context, event_fields_dict):
> pass
> ----
>
> --
> 2.13.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 4/5] perf-script-python.txt: Fix wrong code snippets
2017-05-30 11:18 ` [PATCH 4/5] perf-script-python.txt: Fix wrong code snippets SeongJae Park
@ 2017-06-07 23:35 ` Arnaldo Carvalho de Melo
2017-06-07 23:47 ` SeongJae Park
2017-06-08 22:47 ` [tip:perf/urgent] perf script python: Fix wrong code snippets in documentation tip-bot for SeongJae Park
1 sibling, 1 reply; 17+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-06-07 23:35 UTC (permalink / raw)
To: SeongJae Park; +Cc: peterz, mingo, alexander.shishkin, linux-kernel
Em Tue, May 30, 2017 at 08:18:26PM +0900, SeongJae Park escreveu:
> This commit fixes wrong code snippets for trace_begin() and trace_end()
> function example definition.
Fixed, and using:
git log --follow tools/perf/Documentation/perf-script-python.txt
Added the Fixes: tag:
Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation")
And since you're taking the time to add the Fixes tag (yay, great!)
please also add Cc: entries for the patch author and committer, in that
case:
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
I did it this time, using a script I have:
[acme@jouet linux]$ cat ~/bin/fixes
#!/bin/bash
cset=$1
if [ $# -eq 0 ] ; then
read cset
fi
git show --pretty=fuller $cset | grep '^\(Author\|Commit\): ' | sed -r 's/.*: +/Cc: /g'
echo Fixes: `git one $cset`
[acme@jouet linux]$
Just get the cset, in vim, and select it, pressing Shift+V while the
cursor is on top of the cset id and then press : and finally !fixes +
ENTER :)
cff68e582237
- Arnaldo
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
> ---
> tools/perf/Documentation/perf-script-python.txt | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
> index 44e51351536f..f723ce41268c 100644
> --- a/tools/perf/Documentation/perf-script-python.txt
> +++ b/tools/perf/Documentation/perf-script-python.txt
> @@ -530,7 +530,7 @@ can implement a set of optional functions:
> gives scripts a chance to do setup tasks:
>
> ----
> -def trace_begin:
> +def trace_begin():
> pass
> ----
>
> @@ -539,7 +539,7 @@ def trace_begin:
> as display results:
>
> ----
> -def trace_end:
> +def trace_end():
> pass
> ----
>
> --
> 2.13.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 4/5] perf-script-python.txt: Fix wrong code snippets
2017-06-07 23:35 ` Arnaldo Carvalho de Melo
@ 2017-06-07 23:47 ` SeongJae Park
0 siblings, 0 replies; 17+ messages in thread
From: SeongJae Park @ 2017-06-07 23:47 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: peterz, mingo, alexander.shishkin, linux-kernel
On Thu, Jun 8, 2017 at 8:35 AM, Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> wrote:
> Em Tue, May 30, 2017 at 08:18:26PM +0900, SeongJae Park escreveu:
>> This commit fixes wrong code snippets for trace_begin() and trace_end()
>> function example definition.
>
> Fixed, and using:
>
> git log --follow tools/perf/Documentation/perf-script-python.txt
>
> Added the Fixes: tag:
>
> Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation")
>
> And since you're taking the time to add the Fixes tag (yay, great!)
> please also add Cc: entries for the patch author and committer, in that
> case:
Ok, I will do that from next time.
>
> Cc: Tom Zanussi <tzanussi@gmail.com>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
>
> I did it this time, using a script I have:
>
> [acme@jouet linux]$ cat ~/bin/fixes
> #!/bin/bash
>
> cset=$1
> if [ $# -eq 0 ] ; then
> read cset
> fi
> git show --pretty=fuller $cset | grep '^\(Author\|Commit\): ' | sed -r 's/.*: +/Cc: /g'
> echo Fixes: `git one $cset`
> [acme@jouet linux]$
>
> Just get the cset, in vim, and select it, pressing Shift+V while the
> cursor is on top of the cset id and then press : and finally !fixes +
> ENTER :)
>
> cff68e582237
So sweet script! :D
Thanks,
SeongJae Park
>
> - Arnaldo
>
>> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
>> ---
>> tools/perf/Documentation/perf-script-python.txt | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
>> index 44e51351536f..f723ce41268c 100644
>> --- a/tools/perf/Documentation/perf-script-python.txt
>> +++ b/tools/perf/Documentation/perf-script-python.txt
>> @@ -530,7 +530,7 @@ can implement a set of optional functions:
>> gives scripts a chance to do setup tasks:
>>
>> ----
>> -def trace_begin:
>> +def trace_begin():
>> pass
>> ----
>>
>> @@ -539,7 +539,7 @@ def trace_begin:
>> as display results:
>>
>> ----
>> -def trace_end:
>> +def trace_end():
>> pass
>> ----
>>
>> --
>> 2.13.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [tip:perf/urgent] perf script: Fix outdated comment for perf-trace-python
2017-05-30 11:18 ` [PATCH 1/5] perf script: Fix outdated comment for perf-trace-python SeongJae Park
2017-06-07 23:19 ` Arnaldo Carvalho de Melo
@ 2017-06-08 22:46 ` tip-bot for SeongJae Park
1 sibling, 0 replies; 17+ messages in thread
From: tip-bot for SeongJae Park @ 2017-06-08 22:46 UTC (permalink / raw)
To: linux-tip-commits
Cc: tglx, mingo, sj38.park, acme, alexander.shishkin, linux-kernel,
hpa, peterz
Commit-ID: c76132dc5182776b98e946d674cb41c421661ea9
Gitweb: http://git.kernel.org/tip/c76132dc5182776b98e946d674cb41c421661ea9
Author: SeongJae Park <sj38.park@gmail.com>
AuthorDate: Tue, 30 May 2017 20:18:23 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 7 Jun 2017 20:23:22 -0300
perf script: Fix outdated comment for perf-trace-python
Script generated by the '--gen-script' option contains an outdated
comment. It mentions a 'perf-trace-python' document while it has been
renamed to 'perf-script-python'. Fix it.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 133dc4c39c57 ("perf: Rename 'perf trace' to 'perf script'")
Link: http://lkml.kernel.org/r/20170530111827.21732-2-sj38.park@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/scripting-engines/trace-event-python.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 9d92af7..40de3cb 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -1219,7 +1219,7 @@ static int python_generate_script(struct pevent *pevent, const char *outfile)
fprintf(ofp, "# be retrieved using Python functions of the form "
"common_*(context).\n");
- fprintf(ofp, "# See the perf-trace-python Documentation for the list "
+ fprintf(ofp, "# See the perf-script-python Documentation for the list "
"of available functions.\n\n");
fprintf(ofp, "import os\n");
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [tip:perf/urgent] perf script: Fix documentation errors
2017-05-30 11:18 ` [PATCH 2/5] perf-script-python,perl.txt: Fix typos SeongJae Park
2017-06-07 23:19 ` Arnaldo Carvalho de Melo
@ 2017-06-08 22:47 ` tip-bot for SeongJae Park
1 sibling, 0 replies; 17+ messages in thread
From: tip-bot for SeongJae Park @ 2017-06-08 22:47 UTC (permalink / raw)
To: linux-tip-commits
Cc: sj38.park, tglx, hpa, mingo, acme, fweisbec, peterz,
alexander.shishkin, linux-kernel, tzanussi
Commit-ID: 34d4453dac257be53c21abf2f713c992fb692b5c
Gitweb: http://git.kernel.org/tip/34d4453dac257be53c21abf2f713c992fb692b5c
Author: SeongJae Park <sj38.park@gmail.com>
AuthorDate: Tue, 30 May 2017 20:18:24 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 7 Jun 2017 20:27:20 -0300
perf script: Fix documentation errors
This commit fixes two errors in documents for perf-script-python and
perf-script-perl as below:
- /sys/kernel/debug/tracing events -> /sys/kernel/debug/tracing/events/
- trace_handled -> trace_unhandled
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation")
Link: http://lkml.kernel.org/r/20170530111827.21732-3-sj38.park@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-script-perl.txt | 2 +-
tools/perf/Documentation/perf-script-python.txt | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/Documentation/perf-script-perl.txt b/tools/perf/Documentation/perf-script-perl.txt
index dfbb506..142606c 100644
--- a/tools/perf/Documentation/perf-script-perl.txt
+++ b/tools/perf/Documentation/perf-script-perl.txt
@@ -39,7 +39,7 @@ EVENT HANDLERS
When perf script is invoked using a trace script, a user-defined
'handler function' is called for each event in the trace. If there's
no handler function defined for a given event type, the event is
-ignored (or passed to a 'trace_handled' function, see below) and the
+ignored (or passed to a 'trace_unhandled' function, see below) and the
next event is processed.
Most of the event's field values are passed as arguments to the
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
index 54acba2..087b87c9 100644
--- a/tools/perf/Documentation/perf-script-python.txt
+++ b/tools/perf/Documentation/perf-script-python.txt
@@ -321,7 +321,7 @@ So those are the essential steps in writing and running a script. The
process can be generalized to any tracepoint or set of tracepoints
you're interested in - basically find the tracepoint(s) you're
interested in by looking at the list of available events shown by
-'perf list' and/or look in /sys/kernel/debug/tracing events for
+'perf list' and/or look in /sys/kernel/debug/tracing/events/ for
detailed event and field info, record the corresponding trace data
using 'perf record', passing it the list of interesting events,
generate a skeleton script using 'perf script -g python' and modify the
@@ -437,7 +437,7 @@ EVENT HANDLERS
When perf script is invoked using a trace script, a user-defined
'handler function' is called for each event in the trace. If there's
no handler function defined for a given event type, the event is
-ignored (or passed to a 'trace_handled' function, see below) and the
+ignored (or passed to a 'trace_unhandled' function, see below) and the
next event is processed.
Most of the event's field values are passed as arguments to the
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [tip:perf/urgent] perf script python: Fix wrong code snippets in documentation
2017-05-30 11:18 ` [PATCH 4/5] perf-script-python.txt: Fix wrong code snippets SeongJae Park
2017-06-07 23:35 ` Arnaldo Carvalho de Melo
@ 2017-06-08 22:47 ` tip-bot for SeongJae Park
1 sibling, 0 replies; 17+ messages in thread
From: tip-bot for SeongJae Park @ 2017-06-08 22:47 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, mingo, fweisbec, tglx, hpa, tzanussi,
alexander.shishkin, peterz, acme, sj38.park
Commit-ID: 26ddb8722df865aa67fbe459107d2f3f8e5c6829
Gitweb: http://git.kernel.org/tip/26ddb8722df865aa67fbe459107d2f3f8e5c6829
Author: SeongJae Park <sj38.park@gmail.com>
AuthorDate: Tue, 30 May 2017 20:18:26 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 7 Jun 2017 20:27:26 -0300
perf script python: Fix wrong code snippets in documentation
This commit fixes wrong code snippets for trace_begin() and trace_end()
function example definition.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation")
Link: http://lkml.kernel.org/r/20170530111827.21732-5-sj38.park@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-script-python.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
index 087b87c9..bad6e93 100644
--- a/tools/perf/Documentation/perf-script-python.txt
+++ b/tools/perf/Documentation/perf-script-python.txt
@@ -532,7 +532,7 @@ can implement a set of optional functions:
gives scripts a chance to do setup tasks:
----
-def trace_begin:
+def trace_begin():
pass
----
@@ -541,7 +541,7 @@ def trace_begin:
as display results:
----
-def trace_end:
+def trace_end():
pass
----
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [tip:perf/urgent] perf script python: Updated trace_unhandled() signature
2017-05-30 11:18 ` [PATCH 5/5] perf-script-python.txt: Apply updated trace_unhandled() definition SeongJae Park
2017-06-07 23:27 ` Arnaldo Carvalho de Melo
@ 2017-06-08 22:48 ` tip-bot for SeongJae Park
1 sibling, 0 replies; 17+ messages in thread
From: tip-bot for SeongJae Park @ 2017-06-08 22:48 UTC (permalink / raw)
To: linux-tip-commits
Cc: hpa, peterz, sj38.park, alexander.shishkin, mingo, linux-kernel,
tglx, tardyp, acme
Commit-ID: 1bf8d5a4a5da19b1f6e7958fe67db4118fa7a1c1
Gitweb: http://git.kernel.org/tip/1bf8d5a4a5da19b1f6e7958fe67db4118fa7a1c1
Author: SeongJae Park <sj38.park@gmail.com>
AuthorDate: Tue, 30 May 2017 20:18:27 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 7 Jun 2017 20:27:32 -0300
perf script python: Updated trace_unhandled() signature
Default function signature of trace_unhandled() got changed to include a
field dict, but its documentation, perf-script-python.txt has not been
updated. Fix it.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Pierre Tardy <tardyp@gmail.com>
Fixes: c02514850d67 ("perf scripts python: Give field dict to unhandled callback")
Link: http://lkml.kernel.org/r/20170530111827.21732-6-sj38.park@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-script-python.txt | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
index bad6e93..378783f 100644
--- a/tools/perf/Documentation/perf-script-python.txt
+++ b/tools/perf/Documentation/perf-script-python.txt
@@ -149,10 +149,8 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,
print "id=%d, args=%s\n" % \
(id, args),
-def trace_unhandled(event_name, context, common_cpu, common_secs, common_nsecs,
- common_pid, common_comm):
- print_header(event_name, common_cpu, common_secs, common_nsecs,
- common_pid, common_comm)
+def trace_unhandled(event_name, context, event_fields_dict):
+ print ' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())])
def print_header(event_name, cpu, secs, nsecs, pid, comm):
print "%-20s %5u %05u.%09u %8u %-20s " % \
@@ -550,8 +548,7 @@ def trace_end():
of common arguments are passed into it:
----
-def trace_unhandled(event_name, context, common_cpu, common_secs,
- common_nsecs, common_pid, common_comm):
+def trace_unhandled(event_name, context, event_fields_dict):
pass
----
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [tip:perf/urgent] perf script python: Remove dups in documentation examples
2017-05-30 11:18 ` [PATCH 3/5] perf-script-python.txt: Polish command examples SeongJae Park
@ 2017-06-08 22:49 ` tip-bot for SeongJae Park
0 siblings, 0 replies; 17+ messages in thread
From: tip-bot for SeongJae Park @ 2017-06-08 22:49 UTC (permalink / raw)
To: linux-tip-commits
Cc: sj38.park, linux-kernel, tzanussi, peterz, hpa, fweisbec, acme,
tglx, mingo, alexander.shishkin
Commit-ID: 14fc42fa1b3e7ea5160c84d0e686a3a0c1ffe619
Gitweb: http://git.kernel.org/tip/14fc42fa1b3e7ea5160c84d0e686a3a0c1ffe619
Author: SeongJae Park <sj38.park@gmail.com>
AuthorDate: Tue, 30 May 2017 20:18:25 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 7 Jun 2017 20:36:12 -0300
perf script python: Remove dups in documentation examples
Few shell command examples in perf-script-python.txt has few nitpicks
include:
- tools/perf/scripts/python directory listing command is unnecessarily
repeated.
- few examples contain additional information in command prompt
unnecessarily and inconsistently.
This commit fixes them to enhance readability of the document.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Fixes: cff68e582237 ("perf/scripts: Add perf-trace-python Documentation")
Link: http://lkml.kernel.org/r/20170530111827.21732-4-sj38.park@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-script-python.txt | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/perf/Documentation/perf-script-python.txt b/tools/perf/Documentation/perf-script-python.txt
index 378783f..51ec2d2 100644
--- a/tools/perf/Documentation/perf-script-python.txt
+++ b/tools/perf/Documentation/perf-script-python.txt
@@ -332,7 +332,7 @@ right place, you can have your script listed alongside the other
scripts listed by the 'perf script -l' command e.g.:
----
-root@tropicana:~# perf script -l
+# perf script -l
List of available trace scripts:
wakeup-latency system-wide min/max/avg wakeup latency
rw-by-file <comm> r/w activity for a program, by file
@@ -381,8 +381,6 @@ source tree:
----
# ls -al kernel-source/tools/perf/scripts/python
-
-root@tropicana:/home/trz/src/tip# ls -al tools/perf/scripts/python
total 32
drwxr-xr-x 4 trz trz 4096 2010-01-26 22:30 .
drwxr-xr-x 4 trz trz 4096 2010-01-26 22:29 ..
@@ -397,7 +395,7 @@ otherwise your script won't show up at run-time), 'perf script -l'
should show a new entry for your script:
----
-root@tropicana:~# perf script -l
+# perf script -l
List of available trace scripts:
wakeup-latency system-wide min/max/avg wakeup latency
rw-by-file <comm> r/w activity for a program, by file
^ permalink raw reply related [flat|nested] 17+ messages in thread
end of thread, other threads:[~2017-06-08 22:53 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-30 11:18 [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
2017-05-30 11:18 ` [PATCH 1/5] perf script: Fix outdated comment for perf-trace-python SeongJae Park
2017-06-07 23:19 ` Arnaldo Carvalho de Melo
2017-06-08 22:46 ` [tip:perf/urgent] " tip-bot for SeongJae Park
2017-05-30 11:18 ` [PATCH 2/5] perf-script-python,perl.txt: Fix typos SeongJae Park
2017-06-07 23:19 ` Arnaldo Carvalho de Melo
2017-06-08 22:47 ` [tip:perf/urgent] perf script: Fix documentation errors tip-bot for SeongJae Park
2017-05-30 11:18 ` [PATCH 3/5] perf-script-python.txt: Polish command examples SeongJae Park
2017-06-08 22:49 ` [tip:perf/urgent] perf script python: Remove dups in documentation examples tip-bot for SeongJae Park
2017-05-30 11:18 ` [PATCH 4/5] perf-script-python.txt: Fix wrong code snippets SeongJae Park
2017-06-07 23:35 ` Arnaldo Carvalho de Melo
2017-06-07 23:47 ` SeongJae Park
2017-06-08 22:47 ` [tip:perf/urgent] perf script python: Fix wrong code snippets in documentation tip-bot for SeongJae Park
2017-05-30 11:18 ` [PATCH 5/5] perf-script-python.txt: Apply updated trace_unhandled() definition SeongJae Park
2017-06-07 23:27 ` Arnaldo Carvalho de Melo
2017-06-08 22:48 ` [tip:perf/urgent] perf script python: Updated trace_unhandled() signature tip-bot for SeongJae Park
2017-06-07 22:42 ` [PATCH 0/5] perf: Fix few nitpicks in perf-script SeongJae Park
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).