Skip to content

Commit b3d006c

Browse files
author
Ingo Molnar
committed
Merge branch 'perf/rename' into perf/core
Merge reason: This is an older commit under testing that was not pushed yet - merge it. Also fix up the merge in command-list.txt. Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Tom Zanussi <tzanussi@gmail.com>
2 parents 4c635a4 + 133dc4c commit b3d006c

13 files changed

Lines changed: 121 additions & 121 deletions

File tree

tools/perf/Documentation/perf-trace-perl.txt renamed to tools/perf/Documentation/perf-script-perl.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
perf-trace-perl(1)
1+
perf-script-perl(1)
22
==================
33

44
NAME
55
----
6-
perf-trace-perl - Process trace data with a Perl script
6+
perf-script-perl - Process trace data with a Perl script
77

88
SYNOPSIS
99
--------
1010
[verse]
11-
'perf trace' [-s [Perl]:script[.pl] ]
11+
'perf script' [-s [Perl]:script[.pl] ]
1212

1313
DESCRIPTION
1414
-----------
1515

16-
This perf trace option is used to process perf trace data using perf's
16+
This perf script option is used to process perf script data using perf's
1717
built-in Perl interpreter. It reads and processes the input file and
1818
displays the results of the trace analysis implemented in the given
1919
Perl script, if any.
2020

2121
STARTER SCRIPTS
2222
---------------
2323

24-
You can avoid reading the rest of this document by running 'perf trace
24+
You can avoid reading the rest of this document by running 'perf script
2525
-g perl' in the same directory as an existing perf.data trace file.
2626
That will generate a starter script containing a handler for each of
2727
the event types in the trace file; it simply prints every available
@@ -30,13 +30,13 @@ field for each event in the trace file.
3030
You can also look at the existing scripts in
3131
~/libexec/perf-core/scripts/perl for typical examples showing how to
3232
do basic things like aggregate event data, print results, etc. Also,
33-
the check-perf-trace.pl script, while not interesting for its results,
33+
the check-perf-script.pl script, while not interesting for its results,
3434
attempts to exercise all of the main scripting features.
3535

3636
EVENT HANDLERS
3737
--------------
3838

39-
When perf trace is invoked using a trace script, a user-defined
39+
When perf script is invoked using a trace script, a user-defined
4040
'handler function' is called for each event in the trace. If there's
4141
no handler function defined for a given event type, the event is
4242
ignored (or passed to a 'trace_handled' function, see below) and the
@@ -112,13 +112,13 @@ write a useful trace script. The sections below cover the rest.
112112
SCRIPT LAYOUT
113113
-------------
114114

115-
Every perf trace Perl script should start by setting up a Perl module
115+
Every perf script Perl script should start by setting up a Perl module
116116
search path and 'use'ing a few support modules (see module
117117
descriptions below):
118118

119119
----
120-
use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
121-
use lib "./Perf-Trace-Util/lib";
120+
use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/perf-script-Util/lib";
121+
use lib "./perf-script-Util/lib";
122122
use Perf::Trace::Core;
123123
use Perf::Trace::Context;
124124
use Perf::Trace::Util;
@@ -162,15 +162,15 @@ sub trace_unhandled
162162
----
163163

164164
The remaining sections provide descriptions of each of the available
165-
built-in perf trace Perl modules and their associated functions.
165+
built-in perf script Perl modules and their associated functions.
166166

167167
AVAILABLE MODULES AND FUNCTIONS
168168
-------------------------------
169169

170170
The following sections describe the functions and variables available
171171
via the various Perf::Trace::* Perl modules. To use the functions and
172172
variables from the given module, add the corresponding 'use
173-
Perf::Trace::XXX' line to your perf trace script.
173+
Perf::Trace::XXX' line to your perf script script.
174174

175175
Perf::Trace::Core Module
176176
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -204,7 +204,7 @@ argument.
204204
Perf::Trace::Util Module
205205
~~~~~~~~~~~~~~~~~~~~~~~~
206206

207-
Various utility functions for use with perf trace:
207+
Various utility functions for use with perf script:
208208

209209
nsecs($secs, $nsecs) - returns total nsecs given secs/nsecs pair
210210
nsecs_secs($nsecs) - returns whole secs portion given nsecs
@@ -214,4 +214,4 @@ Various utility functions for use with perf trace:
214214

215215
SEE ALSO
216216
--------
217-
linkperf:perf-trace[1]
217+
linkperf:perf-script[1]

tools/perf/Documentation/perf-trace-python.txt renamed to tools/perf/Documentation/perf-script-python.txt

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
perf-trace-python(1)
1+
perf-script-python(1)
22
====================
33

44
NAME
55
----
6-
perf-trace-python - Process trace data with a Python script
6+
perf-script-python - Process trace data with a Python script
77

88
SYNOPSIS
99
--------
1010
[verse]
11-
'perf trace' [-s [Python]:script[.py] ]
11+
'perf script' [-s [Python]:script[.py] ]
1212

1313
DESCRIPTION
1414
-----------
1515

16-
This perf trace option is used to process perf trace data using perf's
16+
This perf script option is used to process perf script data using perf's
1717
built-in Python interpreter. It reads and processes the input file and
1818
displays the results of the trace analysis implemented in the given
1919
Python script, if any.
@@ -23,15 +23,15 @@ A QUICK EXAMPLE
2323

2424
This section shows the process, start to finish, of creating a working
2525
Python script that aggregates and extracts useful information from a
26-
raw perf trace stream. You can avoid reading the rest of this
26+
raw perf script stream. You can avoid reading the rest of this
2727
document if an example is enough for you; the rest of the document
2828
provides more details on each step and lists the library functions
2929
available to script writers.
3030

3131
This example actually details the steps that were used to create the
32-
'syscall-counts' script you see when you list the available perf trace
33-
scripts via 'perf trace -l'. As such, this script also shows how to
34-
integrate your script into the list of general-purpose 'perf trace'
32+
'syscall-counts' script you see when you list the available perf script
33+
scripts via 'perf script -l'. As such, this script also shows how to
34+
integrate your script into the list of general-purpose 'perf script'
3535
scripts listed by that command.
3636

3737
The syscall-counts script is a simple script, but demonstrates all the
@@ -105,31 +105,31 @@ That single stream will be recorded in a file in the current directory
105105
called perf.data.
106106

107107
Once we have a perf.data file containing our data, we can use the -g
108-
'perf trace' option to generate a Python script that will contain a
108+
'perf script' option to generate a Python script that will contain a
109109
callback handler for each event type found in the perf.data trace
110110
stream (for more details, see the STARTER SCRIPTS section).
111111

112112
----
113-
# perf trace -g python
114-
generated Python script: perf-trace.py
113+
# perf script -g python
114+
generated Python script: perf-script.py
115115

116116
The output file created also in the current directory is named
117-
perf-trace.py. Here's the file in its entirety:
117+
perf-script.py. Here's the file in its entirety:
118118

119-
# perf trace event handlers, generated by perf trace -g python
119+
# perf script event handlers, generated by perf script -g python
120120
# Licensed under the terms of the GNU GPL License version 2
121121

122122
# The common_* event handler fields are the most useful fields common to
123123
# all events. They don't necessarily correspond to the 'common_*' fields
124124
# in the format files. Those fields not available as handler params can
125125
# be retrieved using Python functions of the form common_*(context).
126-
# See the perf-trace-python Documentation for the list of available functions.
126+
# See the perf-script-python Documentation for the list of available functions.
127127

128128
import os
129129
import sys
130130

131131
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
132-
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
132+
'/scripts/python/perf-script-Util/lib/Perf/Trace')
133133

134134
from perf_trace_context import *
135135
from Core import *
@@ -160,7 +160,7 @@ def print_header(event_name, cpu, secs, nsecs, pid, comm):
160160
----
161161

162162
At the top is a comment block followed by some import statements and a
163-
path append which every perf trace script should include.
163+
path append which every perf script script should include.
164164

165165
Following that are a couple generated functions, trace_begin() and
166166
trace_end(), which are called at the beginning and the end of the
@@ -189,8 +189,8 @@ simply a utility function used for that purpose. Let's rename the
189189
script and run it to see the default output:
190190

191191
----
192-
# mv perf-trace.py syscall-counts.py
193-
# perf trace -s syscall-counts.py
192+
# mv perf-script.py syscall-counts.py
193+
# perf script -s syscall-counts.py
194194

195195
raw_syscalls__sys_enter 1 00840.847582083 7506 perf id=1, args=
196196
raw_syscalls__sys_enter 1 00840.847595764 7506 perf id=1, args=
@@ -216,7 +216,7 @@ import os
216216
import sys
217217

218218
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
219-
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
219+
'/scripts/python/perf-script-Util/lib/Perf/Trace')
220220

221221
from perf_trace_context import *
222222
from Core import *
@@ -279,7 +279,7 @@ import os
279279
import sys
280280

281281
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
282-
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
282+
'/scripts/python/perf-script-Util/lib/Perf/Trace')
283283

284284
from perf_trace_context import *
285285
from Core import *
@@ -315,7 +315,7 @@ def print_syscall_totals():
315315

316316
The script can be run just as before:
317317

318-
# perf trace -s syscall-counts.py
318+
# perf script -s syscall-counts.py
319319

320320
So those are the essential steps in writing and running a script. The
321321
process can be generalized to any tracepoint or set of tracepoints
@@ -324,17 +324,17 @@ interested in by looking at the list of available events shown by
324324
'perf list' and/or look in /sys/kernel/debug/tracing events for
325325
detailed event and field info, record the corresponding trace data
326326
using 'perf record', passing it the list of interesting events,
327-
generate a skeleton script using 'perf trace -g python' and modify the
327+
generate a skeleton script using 'perf script -g python' and modify the
328328
code to aggregate and display it for your particular needs.
329329

330330
After you've done that you may end up with a general-purpose script
331331
that you want to keep around and have available for future use. By
332332
writing a couple of very simple shell scripts and putting them in the
333333
right place, you can have your script listed alongside the other
334-
scripts listed by the 'perf trace -l' command e.g.:
334+
scripts listed by the 'perf script -l' command e.g.:
335335

336336
----
337-
root@tropicana:~# perf trace -l
337+
root@tropicana:~# perf script -l
338338
List of available trace scripts:
339339
workqueue-stats workqueue stats (ins/exe/create/destroy)
340340
wakeup-latency system-wide min/max/avg wakeup latency
@@ -365,14 +365,14 @@ perf record -a -e raw_syscalls:sys_enter
365365
The 'report' script is also a shell script with the same base name as
366366
your script, but with -report appended. It should also be located in
367367
the perf/scripts/python/bin directory. In that script, you write the
368-
'perf trace -s' command-line needed for running your script:
368+
'perf script -s' command-line needed for running your script:
369369

370370
----
371371
# cat kernel-source/tools/perf/scripts/python/bin/syscall-counts-report
372372

373373
#!/bin/bash
374374
# description: system-wide syscall counts
375-
perf trace -s ~/libexec/perf-core/scripts/python/syscall-counts.py
375+
perf script -s ~/libexec/perf-core/scripts/python/syscall-counts.py
376376
----
377377

378378
Note that the location of the Python script given in the shell script
@@ -390,17 +390,17 @@ total 32
390390
drwxr-xr-x 4 trz trz 4096 2010-01-26 22:30 .
391391
drwxr-xr-x 4 trz trz 4096 2010-01-26 22:29 ..
392392
drwxr-xr-x 2 trz trz 4096 2010-01-26 22:29 bin
393-
-rw-r--r-- 1 trz trz 2548 2010-01-26 22:29 check-perf-trace.py
394-
drwxr-xr-x 3 trz trz 4096 2010-01-26 22:49 Perf-Trace-Util
393+
-rw-r--r-- 1 trz trz 2548 2010-01-26 22:29 check-perf-script.py
394+
drwxr-xr-x 3 trz trz 4096 2010-01-26 22:49 perf-script-Util
395395
-rw-r--r-- 1 trz trz 1462 2010-01-26 22:30 syscall-counts.py
396396
----
397397

398398
Once you've done that (don't forget to do a new 'make install',
399-
otherwise your script won't show up at run-time), 'perf trace -l'
399+
otherwise your script won't show up at run-time), 'perf script -l'
400400
should show a new entry for your script:
401401

402402
----
403-
root@tropicana:~# perf trace -l
403+
root@tropicana:~# perf script -l
404404
List of available trace scripts:
405405
workqueue-stats workqueue stats (ins/exe/create/destroy)
406406
wakeup-latency system-wide min/max/avg wakeup latency
@@ -409,19 +409,19 @@ List of available trace scripts:
409409
syscall-counts system-wide syscall counts
410410
----
411411

412-
You can now perform the record step via 'perf trace record':
412+
You can now perform the record step via 'perf script record':
413413

414-
# perf trace record syscall-counts
414+
# perf script record syscall-counts
415415

416-
and display the output using 'perf trace report':
416+
and display the output using 'perf script report':
417417

418-
# perf trace report syscall-counts
418+
# perf script report syscall-counts
419419

420420
STARTER SCRIPTS
421421
---------------
422422

423423
You can quickly get started writing a script for a particular set of
424-
trace data by generating a skeleton script using 'perf trace -g
424+
trace data by generating a skeleton script using 'perf script -g
425425
python' in the same directory as an existing perf.data trace file.
426426
That will generate a starter script containing a handler for each of
427427
the event types in the trace file; it simply prints every available
@@ -430,13 +430,13 @@ field for each event in the trace file.
430430
You can also look at the existing scripts in
431431
~/libexec/perf-core/scripts/python for typical examples showing how to
432432
do basic things like aggregate event data, print results, etc. Also,
433-
the check-perf-trace.py script, while not interesting for its results,
433+
the check-perf-script.py script, while not interesting for its results,
434434
attempts to exercise all of the main scripting features.
435435

436436
EVENT HANDLERS
437437
--------------
438438

439-
When perf trace is invoked using a trace script, a user-defined
439+
When perf script is invoked using a trace script, a user-defined
440440
'handler function' is called for each event in the trace. If there's
441441
no handler function defined for a given event type, the event is
442442
ignored (or passed to a 'trace_handled' function, see below) and the
@@ -510,7 +510,7 @@ write a useful trace script. The sections below cover the rest.
510510
SCRIPT LAYOUT
511511
-------------
512512

513-
Every perf trace Python script should start by setting up a Python
513+
Every perf script Python script should start by setting up a Python
514514
module search path and 'import'ing a few support modules (see module
515515
descriptions below):
516516

@@ -519,7 +519,7 @@ descriptions below):
519519
import sys
520520

521521
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
522-
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
522+
'/scripts/python/perf-script-Util/lib/Perf/Trace')
523523

524524
from perf_trace_context import *
525525
from Core import *
@@ -559,15 +559,15 @@ def trace_unhandled(event_name, context, common_cpu, common_secs,
559559
----
560560

561561
The remaining sections provide descriptions of each of the available
562-
built-in perf trace Python modules and their associated functions.
562+
built-in perf script Python modules and their associated functions.
563563

564564
AVAILABLE MODULES AND FUNCTIONS
565565
-------------------------------
566566

567567
The following sections describe the functions and variables available
568-
via the various perf trace Python modules. To use the functions and
568+
via the various perf script Python modules. To use the functions and
569569
variables from the given module, add the corresponding 'from XXXX
570-
import' line to your perf trace script.
570+
import' line to your perf script script.
571571

572572
Core.py Module
573573
~~~~~~~~~~~~~~
@@ -610,7 +610,7 @@ argument.
610610
Util.py Module
611611
~~~~~~~~~~~~~~
612612

613-
Various utility functions for use with perf trace:
613+
Various utility functions for use with perf script:
614614

615615
nsecs(secs, nsecs) - returns total nsecs given secs/nsecs pair
616616
nsecs_secs(nsecs) - returns whole secs portion given nsecs
@@ -620,4 +620,4 @@ Various utility functions for use with perf trace:
620620

621621
SEE ALSO
622622
--------
623-
linkperf:perf-trace[1]
623+
linkperf:perf-script[1]

0 commit comments

Comments
 (0)