• Home
  • Raw
  • Download

Lines Matching +full:linux +full:- +full:format

1 HOWTO - using the library with perf   {#howto_perf}
8 CoreSight IP blocks on a Linux system. The examples have been generated using
9 an aarch64 Juno-r0 platform.
12 On Target Trace Acquisition - Perf Record
13 -----------------------------------------
17 make -C tools/perf
27 make -C tools/perf VF=1 CORESIGHT=1
37 linaro@linaro-nano:~$ ls /sys/bus/coresight/devices/
48 linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -e cs_etm/@tmc_etr0/ --per-thread uname
56 …linaro@linaro-nano:~/kernel$ ./tools/perf/perf record -vvv -e cs_etm/@tmc_etr0/u --per-thread uname
58 -----------------------------------------------------------
70 ------------------------------------------------------------
71 sys_perf_event_open: pid 11375 cpu -1 group_fd -1 flags 0x8
72 ------------------------------------------------------------
90 ------------------------------------------------------------
91 sys_perf_event_open: pid 11375 cpu -1 group_fd -1 flags 0x8
96 Linux
100 7f99daf000-7f99db0000 0 [vdso]
101 7f99d84000-7f99db3000 0 /lib/aarch64-linux-gnu/ld-2.21.so
102 7f99d84000-7f99daf000 0 /lib/aarch64-linux-gnu/ld-2.21.so
103 7f99db0000-7f99db3000 0 /lib/aarch64-linux-gnu/ld-2.21.so
109 linaro@linaro-nano:~/kernel$ ls -l ~/.debug/ perf.data
110 _-rw------- 1 linaro linaro 77888 Mar 2 20:41 perf.data
114 drwxr-xr-x 2 linaro linaro 4096 Mar 2 20:40 [kernel.kallsyms]
115 drwxr-xr-x 2 linaro linaro 4096 Mar 2 20:40 [vdso]
116 drwxr-xr-x 3 linaro linaro 4096 Mar 2 20:40 bin
117 drwxr-xr-x 3 linaro linaro 4096 Mar 2 20:40 lib
120 --------------------
127 On CoreSight two types of address filter have been implemented - address range
136 perf record -e cs_etm/@tmc_etr0/k --filter 'filter 0xffffff8008562d0c/0x48' --per-thread uname
138 …perf record -e cs_etm/@tmc_etr0/u --filter 'filter 0x72c/0x40@/opt/lib/libcstest.so.1.0' --per-thr…
144 $ aarch64-linux-gnu-objdump -d libcstest.so.1.0
147 000000000000072c <coresight_test1>: <------------ Beginning of traces
176 …perf record -e cs_etm/@tmc_etr0/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0' --pe…
178 perf record -vvv -e cs_etm/@tmc_etr0/u --filter 'start 0x72c@/opt/lib/libcstest.so.1.0, \
180 --per-thread ./main
187 …perf record -e cs_etm/@tmc_etr0/k --filter 'start 0xffffff800856bc50,stop 0xffffff800856bcb0, \ /…
189 --per-thread uname
192 ------------------------
195 - Timestamps: These packets are added to the trace streams to allow correlation of different source…
196 - Cycle Counts: These packets are added to get a count of cycles for blocks of executed instruction…
203 perf record -e cs_etm/timestamp,cycacc,@tmc_etr0/ --per-thread uname
208 ---------------------
214 This contains internal format of the parameters described above:
216 root@linaro-developer:~# ls /sys/devices/cs_etm/format
221 root@linaro-developer:~# ls /sys/devices/cs_etm/sinks
224 Note: The `sinkid` parameter is there to document the usage of a 32-bit internal parameter to
230 --------------------------
234 linaro@linaro-nano:~/kernel$ tree ~/.debug
247 └── aarch64-linux-gnu
248 ├── ld-2.21.so
251 └── libc-2.21.so
256 linaro@linaro-nano:~/kernel$
262 linaro@linaro-nano:~/kernel$ tar czf uname.trace.tgz perf.data ~/.debug
270 ------------------------------
275 linaro@t430:~/linaro/coresight$ git clone https://github.com/Linaro/OpenCSD.git my-opencsd
278 remote: Total 2063 (delta 0), reused 0 (delta 0), pack-reused 2063
282 linaro@t430:~/linaro/coresight$ ls my-opencsd
286 take place. For Linux two options are available, LINUX and LINUX64, based on
289 linaro@t430:~/linaro/coresight/$ cd my-opencsd/decoder/build/linux/
290 linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ ls
293 linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ make LINUX64=1 DEBUG=1
297 linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ ls ../../lib/linux64/dbg/
304 linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ sudo make install
305 linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ ls -l /usr/include/opencsd
307 drwxr-xr-x 2 root root 4096 Dec 12 10:19 c_api
308 drwxr-xr-x 2 root root 4096 Dec 12 10:19 etmv3
309 drwxr-xr-x 2 root root 4096 Dec 12 10:19 etmv4
310 -rw-r--r-- 1 root root 28049 Dec 12 10:19 ocsd_if_types.h
311 drwxr-xr-x 2 root root 4096 Dec 12 10:19 ptm
312 drwxr-xr-x 2 root root 4096 Dec 12 10:19 stm
313 -rw-r--r-- 1 root root 7264 Dec 12 10:19 trc_gen_elem_types.h
314 -rw-r--r-- 1 root root 3972 Dec 12 10:19 trc_pkt_types.h
316 linaro@t430:~/linaro/coresight/my-opencsd/decoder/build/linux$ ls -l /usr/lib/libopencsd*
317 -rw-r--r-- 1 root root 598720 Dec 12 10:19 /usr/lib/libopencsd_c_api.so
318 -rw-r--r-- 1 root root 4692200 Dec 12 10:19 /usr/lib/libopencsd.so
327 ---------------------------------
334 linaro@t430:~/linaro/linux-kernel$ make CORESIGHT=1 VF=1 -C tools/perf
335 Auto-detecting system features:
350 ... libdw-dwarf-unwind: [ on ]
355 ... libopencsd: [ on ] <-------
360 linaro@t430:~/linaro/linux-kernel$ ldd tools/perf/perf
361 linux-vdso.so.1 => (0x00007fff135db000)
362 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f15f9176000)
363 librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f15f8f6e000)
364 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f15f8c64000)
365 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f15f8a60000)
366 libopencsd_c_api.so => /usr/lib/libopencsd_c_api.so (0x00007f15f884e000) <-------
367 libelf.so.1 => /usr/lib/x86_64-linux-gnu/libelf.so.1 (0x00007f15f8635000)
368 libdw.so.1 => /usr/lib/x86_64-linux-gnu/libdw.so.1 (0x00007f15f83ec000)
369 libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007f15f81c5000)
370 libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007f15f7e38000)
371 libperl.so.5.22 => /usr/lib/x86_64-linux-gnu/libperl.so.5.22 (0x00007f15f7a5d000)
372 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f15f7693000)
373 libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007f15f7104000)
374 libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f15f6eea000)
375 /lib64/ld-linux-x86-64.so.2 (0x0000559b88038000)
376 libopencsd.so => /usr/lib/libopencsd.so (0x00007f15f6c62000) <-------
377 libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f15f68df000)
378 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f15f66c9000)
379 liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f15f64a6000)
380 libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f15f6296000)
381 libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f15f605e000)
382 libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f15f5e5a000)
387 output as follows:-
395 --------------------------------------------------------
403 …linaro@t430:~/linaro/linux-kernel$ export CSINCLUDES=~/linaro/coresight/my-opencsd/decoder/include/
404 …linaro@t430:~/linaro/linux-kernel$ export CSLIBS=~/linaro/coresight/my-opencsd/decoder/lib/builddi…
405 linaro@t430:~/linaro/linux-kernel$ make CORESIGHT=1 VF=1 -C tools/perf
411 linaro@t430:~/linaro/linux-kernel$ export LD_LIBRARY_PATH=$CSLIBS
415 -------------------------------
427 linaro@t430:~/linaro/coresight/sept20$ ls -la
429 drwxrwxr-x 3 linaro linaro 4096 Mar 3 10:26 .
430 drwxrwxr-x 5 linaro linaro 4096 Mar 3 10:13 ..
431 drwxr-xr-x 7 linaro linaro 4096 Feb 24 12:21 .debug
432 -rw------- 1 linaro linaro 78016 Feb 24 12:21 perf.data
433 -rw-rw-r-- 1 linaro linaro 1245881 Feb 24 12:25 uname.v4.user.sept20.tgz
439 perf config --system buildid.dir=/my/own/buildid/dir
443 linaro@t430:~/linaro/coresight/sept20$ rm -rf ~/.debug
444 linaro@t430:~/linaro/coresight/sept20$ cp -dpR .debug ~/
445 linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf report --stdio
447 # To display the perf.data header info, please use --header/--header-only options.
474 4.13% 4.13% uname libc-2.21.so [.] 0x0000000000078758
475 3.81% 3.81% uname libc-2.21.so [.] 0x0000000000078e50
476 2.06% 2.06% uname libc-2.21.so [.] 0x00000000000fcaf4
477 1.65% 1.65% uname libc-2.21.so [.] 0x00000000000fcae4
478 1.59% 1.59% uname ld-2.21.so [.] 0x000000000000a7f4
479 1.50% 1.50% uname libc-2.21.so [.] 0x0000000000078e40
480 1.43% 1.43% uname libc-2.21.so [.] 0x00000000000fcac4
481 1.31% 1.31% uname libc-2.21.so [.] 0x000000000002f0c0
482 1.26% 1.26% uname ld-2.21.so [.] 0x0000000000016888
483 1.24% 1.24% uname libc-2.21.so [.] 0x0000000000078e7c
484 1.24% 1.24% uname libc-2.21.so [.] 0x00000000000fcab8
489 mjl@ubuntu-vbox:./perf-opencsd-master/coresight/tools/perf/perf report --stdio --dump
491 resulting a large amount of data, trace looking like:-
493 …PERF_RECORD_AUXTRACE size: 0x11ef0 offset: 0 ref: 0x4d881c1f13216016 idx: 0 tid: 15244 cpu: -1
501 28: I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
502 29: I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
503 30: I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
504 32: I_ATOM_F6 : Atom format 6.; EEEEN
505 33: I_ATOM_F1 : Atom format 1.; E
511 68: I_ATOM_F3 : Atom format 3.; NEE
512 69: I_ATOM_F3 : Atom format 3.; NEN
513 70: I_ATOM_F3 : Atom format 3.; NNE
514 71: I_ATOM_F5 : Atom format 5.; ENENE
515 72: I_ATOM_F5 : Atom format 5.; NENEN
516 73: I_ATOM_F5 : Atom format 5.; ENENE
517 74: I_ATOM_F5 : Atom format 5.; NENEN
518 75: I_ATOM_F5 : Atom format 5.; ENENE
519 76: I_ATOM_F3 : Atom format 3.; NNE
520 77: I_ATOM_F3 : Atom format 3.; NNE
521 78: I_ATOM_F3 : Atom format 3.; NNE
522 80: I_ATOM_F3 : Atom format 3.; NNE
523 81: I_ATOM_F3 : Atom format 3.; ENN
529 116: I_ATOM_F5 : Atom format 5.; NNNNN
530 117: I_ATOM_F5 : Atom format 5.; NNNNN
534 -------------------------------
538 …linaro@t430:~/linaro/coresight/sept20$ export EXEC_PATH=/home/linaro/coresight/perf-opencsd-master…
541-opencsd-master/tools/perf/perf --exec-path=${EXEC_PATH} script --script=python:${SCRIPT_PATH}/cs-
546 7f89f282d4: a9ba7bfd stp x29, x30, [sp,#-96]!
568 ---------------------
571 explicitely to perf using the "--vmlinux" command line option:
573 …linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf report --stdio --vml…
576 …linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf script --vmlinux=./v…
581 …linaro@t430:~/linaro/coresight/sept20$ export EXEC_PATH=/home/linaro/coresight/perf-opencsd-master…
584 …linaro@t430:~/linaro/coresight/sept20$ ../perf-opencsd-master/tools/perf/perf --exec-path=${EXEC_P…
585 --vmlinux=./vmlinux \
586 --script=python:${SCRIPT_PATH}/cs-trace-disasm.py -- \
587 -d ${XTOOLS_PATH}/aarch64-linux-gnu-objdump \
588 -k ./vmlinux
592 The option "--vmlinux=./vmlinux" is interpreted by the "perf script" command
593 the same way it if for "perf report". The option "-k ./vmlinux" is dependant
594 on the script being executed and has no related to the "--vmlinux", though it
599 -----------------------------
606 decoder/tests/perf-test-scripts
610 - `perf-setup-env.bash` : this sets up all the environment variables mentioned above.
611 - `perf-test-report.bash` : this runs `perf report` - using the environment setup by `perf-setup-e…
612 - `perf-test-script.bash` : this runs `perf script` - using the environment setup by `perf-setup-e…
614 Use as follows:-
616 1. Prior to building perf, edit `perf-setup-env.bash` to conform to your environment. There are fou…
620 source perf-setup-env.bash
626 source perf-setup-env.base buildenv
629 environment for using the used by the `perf-test...` scripts to run the tests.
633 5. Copy the `perf-test...` scripts into the capture data directory -> the one that contains `perf.d…
639 ./perf-test-report.bash --dump
641 will add the --dump option to the end of the command line and run
643 ${PERF_EXEC_PATH}/perf report --stdio --dump
647 ---------------------------------------------------------------------
653 -------------------------
654 - Mike Leach
655 - Mathieu Poirier
659 --------------
666 --------------------------------------