← Documents Documentation/trace/coresight/coresight-perf.rst GitHub 원문 ↗

Linux 6.18.37 · Tracing

CoreSight - Perf

Perf로 CoreSight AUX trace를 기록·decode하고 event 기반 pause/resume, kernel 설정, self-test 변동성과 통계·data 보관 경로를 관리하는 방법을 설명합니다.

Source pathDocumentation/trace/coresight/coresight-perf.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

coresight-perf.rst:1-189

Perf로 CoreSight AUX trace를 기록·decode하고 event 기반 pause/resume, kernel 설정, self-test 변동성과 통계·data 보관 경로를 관리하는 방법을 설명합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ================
4 CoreSight - Perf
5 ================
6
7 :Author: Carsten Haitzler <[email protected]>
8 :Date: June 29th, 2022
9
10 Perf is able to locally access CoreSight trace data and store it to the
11 output perf data files. This data can then be later decoded to give the
12 instructions that were traced for debugging or profiling purposes. You
13 can log such data with a perf record command like::
14
15 perf record -e cs_etm//u testbinary
16
17 This would run some test binary (testbinary) until it exits and record
18 a perf.data trace file. That file would have AUX sections if CoreSight
19 is working correctly. You can dump the content of this file as
20 readable text with a command like::
21
22 perf report --stdio --dump -i perf.data
23
24 You should find some sections of this file have AUX data blocks like::
25
26 0x1e78 [0x30]: PERF_RECORD_AUXTRACE size: 0x11dd0 offset: 0 ref: 0x1b614fc1061b0ad1 idx: 0 tid: 531230 cpu: -1
27
28 . ... CoreSight ETM Trace data: size 73168 bytes
29 Idx:0; ID:10; I_ASYNC : Alignment Synchronisation.
30 Idx:12; ID:10; I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 }
31 Idx:17; ID:10; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0x0000000000000000;
32 Idx:26; ID:10; I_TRACE_ON : Trace On.
33 Idx:27; ID:10; I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0x0000FFFFB6069140; Ctxt: AArch64,EL0, NS;
34 Idx:38; ID:10; I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
35 Idx:39; ID:10; I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
36 Idx:40; ID:10; I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
37 Idx:41; ID:10; I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEN
38 ...
39
40 If you see these above, then your system is tracing CoreSight data
41 correctly.
42
43 To compile perf with CoreSight support in the tools/perf directory do::
44
45 make CORESIGHT=1
46
47 This requires OpenCSD to build. You may install distribution packages
48 for the support such as libopencsd and libopencsd-dev or download it
49 and build yourself. Upstream OpenCSD is located at:
50
51 https://github.com/Linaro/OpenCSD
52
53 For complete information on building perf with CoreSight support and
54 more extensive usage look at:
55
56 https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md
57
58
59 Kernel CoreSight Support
60 ------------------------
61
62 You will also want CoreSight support enabled in your kernel config.
63 Ensure it is enabled with::
64
65 CONFIG_CORESIGHT=y
66
67 There are various other CoreSight options you probably also want
68 enabled like::
69
70 CONFIG_CORESIGHT_LINKS_AND_SINKS=y
71 CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
72 CONFIG_CORESIGHT_CATU=y
73 CONFIG_CORESIGHT_SINK_TPIU=y
74 CONFIG_CORESIGHT_SINK_ETBV10=y
75 CONFIG_CORESIGHT_SOURCE_ETM4X=y
76 CONFIG_CORESIGHT_CTI=y
77 CONFIG_CORESIGHT_CTI_INTEGRATION_REGS=y
78
79 Please refer to the kernel configuration help for more information.
80
81 Fine-grained tracing with AUX pause and resume
82 ----------------------------------------------
83
84 Arm CoreSight may generate a large amount of hardware trace data, which
85 will lead to overhead in recording and distract users when reviewing
86 profiling result. To mitigate the issue of excessive trace data, Perf
87 provides AUX pause and resume functionality for fine-grained tracing.
88
89 The AUX pause and resume can be triggered by associated events. These
90 events can be ftrace tracepoints (including static and dynamic
91 tracepoints) or PMU events (e.g. CPU PMU cycle event). To create a perf
92 session with AUX pause / resume, three configuration terms are
93 introduced:
94
95 - "aux-action=start-paused": it is specified for the cs_etm PMU event to
96 launch in a paused state.
97 - "aux-action=pause": an associated event is specified with this term
98 to pause AUX trace.
99 - "aux-action=resume": an associated event is specified with this term
100 to resume AUX trace.
101
102 Example for triggering AUX pause and resume with ftrace tracepoints::
103
104 perf record -e cs_etm/aux-action=start-paused/k,syscalls:sys_enter_openat/aux-action=resume/,syscalls:sys_exit_openat/aux-action=pause/ ls
105
106 Example for triggering AUX pause and resume with PMU event::
107
108 perf record -a -e cs_etm/aux-action=start-paused/k \
109 -e cycles/aux-action=pause,period=10000000/ \
110 -e cycles/aux-action=resume,period=1050000/ -- sleep 1
111
112 Perf test - Verify kernel and userspace perf CoreSight work
113 -----------------------------------------------------------
114
115 When you run perf test, it will do a lot of self tests. Some of those
116 tests will cover CoreSight (only if enabled and on ARM64). You
117 generally would run perf test from the tools/perf directory in the
118 kernel tree. Some tests will check some internal perf support like:
119
120 Check Arm CoreSight trace data recording and synthesized samples
121 Check Arm SPE trace data recording and synthesized samples
122
123 Some others will actually use perf record and some test binaries that
124 are in tests/shell/coresight and will collect traces to ensure a
125 minimum level of functionality is met. The scripts that launch these
126 tests are in the same directory. These will all look like:
127
128 CoreSight / ASM Pure Loop
129 CoreSight / Memcpy 16k 10 Threads
130 CoreSight / Thread Loop 10 Threads - Check TID
131 etc.
132
133 These perf record tests will not run if the tool binaries do not exist
134 in tests/shell/coresight/\*/ and will be skipped. If you do not have
135 CoreSight support in hardware then either do not build perf with
136 CoreSight support or remove these binaries in order to not have these
137 tests fail and have them skip instead.
138
139 These tests will log historical results in the current working
140 directory (e.g. tools/perf) and will be named stats-\*.csv like:
141
142 stats-asm_pure_loop-out.csv
143 stats-memcpy_thread-16k_10.csv
144 ...
145
146 These statistic files log some aspects of the AUX data sections in
147 the perf data output counting some numbers of certain encodings (a
148 good way to know that it's working in a very simple way). One problem
149 with CoreSight is that given a large enough amount of data needing to
150 be logged, some of it can be lost due to the processor not waking up
151 in time to read out all the data from buffers etc.. You will notice
152 that the amount of data collected can vary a lot per run of perf test.
153 If you wish to see how this changes over time, simply run perf test
154 multiple times and all these csv files will have more and more data
155 appended to it that you can later examine, graph and otherwise use to
156 figure out if things have become worse or better.
157
158 This means sometimes these tests fail as they don't capture all the
159 data needed. This is about tracking quality and amount of data
160 produced over time and to see when changes to the Linux kernel improve
161 quality of traces.
162
163 Be aware that some of these tests take quite a while to run, specifically
164 in processing the perf data file and dumping contents to then examine what
165 is inside.
166
167 You can change where these csv logs are stored by setting the
168 PERF_TEST_CORESIGHT_STATDIR environment variable before running perf
169 test like::
170
171 export PERF_TEST_CORESIGHT_STATDIR=/var/tmp
172 perf test
173
174 They will also store resulting perf output data in the current
175 directory for later inspection like::
176
177 perf-asm_pure_loop-out.data
178 perf-memcpy_thread-16k_10.data
179 ...
180
181 You can alter where the perf data files are stored by setting the
182 PERF_TEST_CORESIGHT_DATADIR environment variable such as::
183
184 PERF_TEST_CORESIGHT_DATADIR=/var/tmp
185 perf test
186
187 You may wish to set these above environment variables if you wish to
188 keep the output of tests outside of the current working directory for
189 longer term storage and examination.
190

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Perf 기록·decode와 OpenCSD build

1-58

이 문서는 Carsten Haitzler가 2022년 6월 29일에 작성했으며, Perf가 CoreSight trace data를 로컬에서 수집하고 해석하는 방법을 설명한다.

Perf는 CoreSight trace data를 직접 읽어 output perf data file에 저장한다. 이후 이 data를 decode하면 debugging 또는 profiling을 위해 trace된 instruction을 확인할 수 있다.

`perf record -e cs_etm//u testbinary`는 `testbinary`가 종료될 때까지 실행하면서 `perf.data` trace file을 만든다. CoreSight가 정상 동작하면 이 file에 AUX section이 포함된다.

`perf report --stdio --dump -i perf.data`는 file 내용을 읽을 수 있는 text로 dump한다. 정상 AUX block에는 `PERF_RECORD_AUXTRACE`의 size, offset, reference, index, TID, CPU와 함께 CoreSight ETM packet이 나타난다.

예제 packet은 alignment synchronization인 `I_ASYNC`, trace 정보 `I_TRACE_INFO`, 64-bit address `I_ADDR_L_64IS0`, `I_TRACE_ON`, AArch64 EL0 non-secure context를 포함한 `I_ADDR_CTXT_L_64IS0`, 여러 `I_ATOM_F6` atom을 보여 준다. 이런 내용이 보이면 CoreSight data tracing이 정상이다.

`tools/perf`에서 CoreSight 지원을 넣어 Perf를 build하려면 `make CORESIGHT=1`을 사용한다. build에는 OpenCSD가 필요하며 `libopencsd`, `libopencsd-dev` distribution package를 설치하거나 upstream source를 내려받아 직접 build할 수 있다.

upstream OpenCSD는 `https://github.com/Linaro/OpenCSD`에 있고, Perf CoreSight build와 확장 사용법은 `https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md`를 참조한다.

CoreSight Perf 처리
cs_etm PMU traceperf record
perf.data AUX sectionperf report --dump
OpenCSD decodeInstruction flow for debug/profile

hardware trace를 perf.data AUX section에 저장한 뒤 OpenCSD로 decode한다.

정상 AUX packet 표식
Packet의미
I_ASYNCalignment synchronization
I_TRACE_INFOtrace configuration information
I_ADDR_L_64IS064-bit address
I_TRACE_ONtrace 시작
I_ADDR_CTXT_L_64IS0address와 AArch64/EL/security context
I_ATOM_F6executed/not-executed atom sequence

dump에서 확인할 수 있는 대표 ETMv4 packet이다.

Build 의존성
항목설정
Perf buildmake CORESIGHT=1
Distribution packagelibopencsd, libopencsd-dev
Upstreamgithub.com/Linaro/OpenCSD

Perf의 CoreSight decode 기능에는 OpenCSD가 필요하다.

.. SPDX-License-Identifier: GPL-2.0

================
CoreSight - Perf
================

    :Author:   Carsten Haitzler <[email protected]>
    :Date:     June 29th, 2022

Perf is able to locally access CoreSight trace data and store it to the
output perf data files. This data can then be later decoded to give the
instructions that were traced for debugging or profiling purposes. You
can log such data with a perf record command like::

   perf record -e cs_etm//u testbinary

This would run some test binary (testbinary) until it exits and record
a perf.data trace file. That file would have AUX sections if CoreSight
is working correctly. You can dump the content of this file as
readable text with a command like::

   perf report --stdio --dump -i perf.data

You should find some sections of this file have AUX data blocks like::

   0x1e78 [0x30]: PERF_RECORD_AUXTRACE size: 0x11dd0  offset: 0  ref: 0x1b614fc1061b0ad1  idx: 0  tid: 531230  cpu: -1

   . ... CoreSight ETM Trace data: size 73168 bytes
           Idx:0; ID:10;   I_ASYNC : Alignment Synchronisation.
             Idx:12; ID:10;  I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 }
             Idx:17; ID:10;  I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0x0000000000000000;
             Idx:26; ID:10;  I_TRACE_ON : Trace On.
             Idx:27; ID:10;  I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0x0000FFFFB6069140; Ctxt: AArch64,EL0, NS;
             Idx:38; ID:10;  I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
             Idx:39; ID:10;  I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
             Idx:40; ID:10;  I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEEEEEEEEEEEEEE
             Idx:41; ID:10;  I_ATOM_F6 : Atom format 6.; EEEEEEEEEEEN
             ...

If you see these above, then your system is tracing CoreSight data
correctly.

To compile perf with CoreSight support in the tools/perf directory do::

    make CORESIGHT=1

This requires OpenCSD to build. You may install distribution packages
for the support such as libopencsd and libopencsd-dev or download it
and build yourself. Upstream OpenCSD is located at:

  https://github.com/Linaro/OpenCSD

For complete information on building perf with CoreSight support and
more extensive usage look at:

  https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md

Kernel CoreSight configuration

59-80

kernel configuration에서도 CoreSight 지원을 enable해야 하며 기본 option은 `CONFIG_CORESIGHT=y`다.

일반적으로 link와 sink, TMC, CATU, TPIU, ETB v1.0, ETMv4 source, CTI와 CTI integration register option도 함께 enable한다. 각 option의 세부 조건은 kernel configuration help를 참조한다.

권장 kernel option
Option역할
CONFIG_CORESIGHTCoreSight framework
CONFIG_CORESIGHT_LINKS_AND_SINKS공통 link와 sink
CONFIG_CORESIGHT_LINK_AND_SINK_TMCTMC link/sink
CONFIG_CORESIGHT_CATUCoreSight Address Translation Unit
CONFIG_CORESIGHT_SINK_TPIUTPIU sink
CONFIG_CORESIGHT_SINK_ETBV10ETB v1.0 sink
CONFIG_CORESIGHT_SOURCE_ETM4XETMv4 trace source
CONFIG_CORESIGHT_CTICross Trigger Interface
CONFIG_CORESIGHT_CTI_INTEGRATION_REGSCTI integration register

사용하는 hardware topology에 맞는 source·link·sink와 CTI support를 선택한다.

Kernel 지원 계층
CONFIG_CORESIGHTETM4X source
CONFIG_CORESIGHTLinks and sinks
CONFIG_CORESIGHTCTI integration

framework 위에 source, link/sink와 cross-trigger 구성요소를 조합한다.

Kernel CoreSight Support
------------------------

You will also want CoreSight support enabled in your kernel config.
Ensure it is enabled with::

   CONFIG_CORESIGHT=y

There are various other CoreSight options you probably also want
enabled like::

   CONFIG_CORESIGHT_LINKS_AND_SINKS=y
   CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
   CONFIG_CORESIGHT_CATU=y
   CONFIG_CORESIGHT_SINK_TPIU=y
   CONFIG_CORESIGHT_SINK_ETBV10=y
   CONFIG_CORESIGHT_SOURCE_ETM4X=y
   CONFIG_CORESIGHT_CTI=y
   CONFIG_CORESIGHT_CTI_INTEGRATION_REGS=y

Please refer to the kernel configuration help for more information.

Event 기반 AUX pause와 resume

81-111

Arm CoreSight는 매우 많은 hardware trace data를 만들 수 있어 recording overhead를 높이고 profiling 결과 검토를 방해할 수 있다. Perf의 AUX pause/resume 기능은 필요한 구간만 세밀하게 trace해 과도한 data를 줄인다.

pause와 resume은 연계 event로 trigger할 수 있다. event는 static/dynamic ftrace tracepoint 또는 CPU PMU cycle event 같은 PMU event가 될 수 있다.

`aux-action=start-paused`는 `cs_etm` PMU event를 paused state로 시작한다. `aux-action=pause`가 붙은 연계 event는 AUX trace를 멈추고, `aux-action=resume`이 붙은 event는 다시 시작한다.

ftrace 예제는 `sys_enter_openat`에서 resume하고 `sys_exit_openat`에서 pause해 `ls`의 openat 구간을 기록한다. PMU 예제는 system-wide recording에서 cycle event의 서로 다른 period로 pause와 resume을 반복하며 1초 동안 실행한다.

AUX action
Term적용 대상동작
start-pausedcs_etm PMU eventsession을 paused로 시작
pauseftrace/PMU associated eventAUX trace 중지
resumeftrace/PMU associated eventAUX trace 재개

CoreSight event와 연계 event에 부여하는 세 configuration term이다.

Fine-grained trace
cs_etm start-pausedResume event
Resume eventAUX trace active
AUX trace activePause event
Pause eventAUX trace paused

관심 event 사이에서만 AUX trace를 활성화한다.

Fine-grained tracing with AUX pause and resume
----------------------------------------------

Arm CoreSight may generate a large amount of hardware trace data, which
will lead to overhead in recording and distract users when reviewing
profiling result. To mitigate the issue of excessive trace data, Perf
provides AUX pause and resume functionality for fine-grained tracing.

The AUX pause and resume can be triggered by associated events. These
events can be ftrace tracepoints (including static and dynamic
tracepoints) or PMU events (e.g. CPU PMU cycle event). To create a perf
session with AUX pause / resume, three configuration terms are
introduced:

- "aux-action=start-paused": it is specified for the cs_etm PMU event to
  launch in a paused state.
- "aux-action=pause": an associated event is specified with this term
  to pause AUX trace.
- "aux-action=resume": an associated event is specified with this term
  to resume AUX trace.

Example for triggering AUX pause and resume with ftrace tracepoints::

  perf record -e cs_etm/aux-action=start-paused/k,syscalls:sys_enter_openat/aux-action=resume/,syscalls:sys_exit_openat/aux-action=pause/ ls

Example for triggering AUX pause and resume with PMU event::

  perf record -a -e cs_etm/aux-action=start-paused/k \
        -e cycles/aux-action=pause,period=10000000/ \
        -e cycles/aux-action=resume,period=1050000/ -- sleep 1

Perf CoreSight self-test와 통계 변동

112-166

`perf test`는 많은 self-test를 실행하며 CoreSight가 enable된 ARM64에서는 CoreSight test도 포함한다. 일반적으로 kernel tree의 `tools/perf` directory에서 실행한다.

일부 test는 `Check Arm CoreSight trace data recording and synthesized samples`, `Check Arm SPE trace data recording and synthesized samples`처럼 Perf 내부 지원을 확인한다.

다른 test는 `tests/shell/coresight`의 test binary에 실제 `perf record`를 실행해 최소 기능 수준을 확인한다. 예로 ASM pure loop, 16 KB memcpy 10 thread, TID를 확인하는 10-thread loop 등이 있으며 실행 script도 같은 directory에 있다.

`tests/shell/coresight/*/` 아래 tool binary가 없으면 이 recording test는 실행되지 않고 skip된다. hardware에 CoreSight가 없다면 Perf를 CoreSight support 없이 build하거나 해당 binary를 제거해 실패 대신 skip되게 해야 한다.

test는 현재 working directory, 예를 들어 `tools/perf`에 `stats-*.csv` 이름으로 이전 결과를 누적한다. `stats-asm_pure_loop-out.csv`, `stats-memcpy_thread-16k_10.csv`가 예다.

CSV는 perf data의 AUX section에서 특정 encoding 수를 세어 단순한 동작 지표를 남긴다. CoreSight는 data 양이 충분히 크면 processor가 제때 깨어 buffer를 모두 읽지 못해 일부 trace를 잃을 수 있다. 그래서 `perf test` 실행마다 수집량이 크게 달라질 수 있다.

test를 여러 번 실행하면 CSV에 data가 계속 append되므로 시간에 따른 변화를 검토하거나 graph로 만들어 품질이 좋아졌는지 나빠졌는지 판단할 수 있다.

필요한 data를 모두 capture하지 못해 test가 가끔 실패할 수 있다. 이 test의 목적은 생성되는 trace의 품질과 양을 장기 추적하고 Linux kernel 변경이 품질을 개선하는 시점을 찾는 데 있다.

일부 test는 perf data file을 처리하고 내용을 dump해 검사하는 단계 때문에 상당히 오래 걸릴 수 있다.

CoreSight test 종류
종류
Internal supportCoreSight/SPE recording and synthesized samples
Shell recordingASM Pure Loop
Multi-thread memoryMemcpy 16k 10 Threads
Thread identityThread Loop 10 Threads - Check TID

내부 decode 지원과 실제 recording workflow를 함께 검증한다.

통계 누적의 의미
Run perf testCollect AUX encodings
Possible buffer lossPer-run variation
Append stats CSVTrend and graph
Compare over timeTrace quality regression/improvement

변동성이 있는 AUX 수집량을 여러 실행에 걸쳐 비교한다.

Perf test - Verify kernel and userspace perf CoreSight work
-----------------------------------------------------------

When you run perf test, it will do a lot of self tests. Some of those
tests will cover CoreSight (only if enabled and on ARM64). You
generally would run perf test from the tools/perf directory in the
kernel tree. Some tests will check some internal perf support like:

   Check Arm CoreSight trace data recording and synthesized samples
   Check Arm SPE trace data recording and synthesized samples

Some others will actually use perf record and some test binaries that
are in tests/shell/coresight and will collect traces to ensure a
minimum level of functionality is met. The scripts that launch these
tests are in the same directory. These will all look like:

   CoreSight / ASM Pure Loop
   CoreSight / Memcpy 16k 10 Threads
   CoreSight / Thread Loop 10 Threads - Check TID
   etc.

These perf record tests will not run if the tool binaries do not exist
in tests/shell/coresight/\*/ and will be skipped. If you do not have
CoreSight support in hardware then either do not build perf with
CoreSight support or remove these binaries in order to not have these
tests fail and have them skip instead.

These tests will log historical results in the current working
directory (e.g. tools/perf) and will be named stats-\*.csv like:

   stats-asm_pure_loop-out.csv
   stats-memcpy_thread-16k_10.csv
   ...

These statistic files log some aspects of the AUX data sections in
the perf data output counting some numbers of certain encodings (a
good way to know that it's working in a very simple way). One problem
with CoreSight is that given a large enough amount of data needing to
be logged, some of it can be lost due to the processor not waking up
in time to read out all the data from buffers etc.. You will notice
that the amount of data collected can vary a lot per run of perf test.
If you wish to see how this changes over time, simply run perf test
multiple times and all these csv files will have more and more data
appended to it that you can later examine, graph and otherwise use to
figure out if things have become worse or better.

This means sometimes these tests fail as they don't capture all the
data needed. This is about tracking quality and amount of data
produced over time and to see when changes to the Linux kernel improve
quality of traces.

Be aware that some of these tests take quite a while to run, specifically
in processing the perf data file and dumping contents to then examine what
is inside.

Test output 장기 보관 경로

167-189

`PERF_TEST_CORESIGHT_STATDIR` environment variable을 `perf test` 전에 설정하면 CSV log 저장 위치를 바꿀 수 있다. 원문 예제는 `/var/tmp`로 지정한다.

test는 나중에 검사할 Perf output data도 현재 directory에 남긴다. `perf-asm_pure_loop-out.data`, `perf-memcpy_thread-16k_10.data`가 예다.

`PERF_TEST_CORESIGHT_DATADIR` environment variable은 perf data file 저장 위치를 바꾼다. CSV와 perf data를 현재 working directory 밖에서 장기간 보관하고 검토하려면 두 environment variable을 설정하는 것이 좋다.

CoreSight test output 위치
환경 변수대상예제
PERF_TEST_CORESIGHT_STATDIRstats-*.csv/var/tmp
PERF_TEST_CORESIGHT_DATADIRperf-*.data/var/tmp

통계와 원시 perf data의 저장 경로를 별도로 제어한다.

장기 결과 보관
perf testPERF_TEST_CORESIGHT_DATADIR
perf testPERF_TEST_CORESIGHT_STATDIR
Stored outputsLong-term examination

원시 data와 누적 통계를 분리된 외부 directory에 보존한다.

You can change where these csv logs are stored by setting the
PERF_TEST_CORESIGHT_STATDIR environment variable before running perf
test like::

   export PERF_TEST_CORESIGHT_STATDIR=/var/tmp
   perf test

They will also store resulting perf output data in the current
directory for later inspection like::

   perf-asm_pure_loop-out.data
   perf-memcpy_thread-16k_10.data
   ...

You can alter where the perf data files are stored by setting the
PERF_TEST_CORESIGHT_DATADIR environment variable such as::

   PERF_TEST_CORESIGHT_DATADIR=/var/tmp
   perf test

You may wish to set these above environment variables if you wish to
keep the output of tests outside of the current working directory for
longer term storage and examination.