€•hŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ2/translations/zh_CN/trace/coresight/coresight-perf”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/zh_TW/trace/coresight/coresight-perf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/it_IT/trace/coresight/coresight-perf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/ja_JP/trace/coresight/coresight-perf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/ko_KR/trace/coresight/coresight-perf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/pt_BR/trace/coresight/coresight-perf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/sp_SP/trace/coresight/coresight-perf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒL/var/lib/git/docbuild/linux/Documentation/trace/coresight/coresight-perf.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒCoreSight - Perf”h]”hŒCoreSight - Perf”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ block_quote”“”)”}”(hŒR:Author: Carsten Haitzler :Date: June 29th, 2022 ”h]”hŒ field_list”“”)”}”(hhh]”(hŒfield”“”)”}”(hhh]”(hŒ field_name”“”)”}”(hŒAuthor”h]”hŒAuthor”…””}”(hhïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1híhhêh³hÇh´KubhŒ field_body”“”)”}”(hŒ+Carsten Haitzler ”h]”hŒ paragraph”“”)”}”(hjh]”(hŒCarsten Haitzler <”…””}”(hjh²hh³Nh´NubhŒ reference”“”)”}”(hŒcarsten.haitzler@arm.com”h]”hŒcarsten.haitzler@arm.com”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:carsten.haitzler@arm.com”uh1j hjubhŒ>”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Khhÿubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhhêubeh}”(h]”h ]”h"]”h$]”h&]”uh1hèh³hÇh´Khhåubhé)”}”(hhh]”(hî)”}”(hŒDate”h]”hŒDate”…””}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1híhj4h³hÇh´Kubhþ)”}”(hŒJune 29th, 2022 ”h]”j)”}”(hŒJune 29th, 2022”h]”hŒJune 29th, 2022”…””}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KhjEubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhj4ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hèh³hÇh´Khhåubeh}”(h]”h ]”h"]”h$]”h&]”uh1hãhhßubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubj)”}”(hX 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::”h]”hX 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:”…””}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K hhÊh²hubhŒ literal_block”“”)”}”(hŒ#perf record -e cs_etm//u testbinary”h]”hŒ#perf record -e cs_etm//u testbinary”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´KhhÊh²hubj)”}”(hŒð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::”h]”hŒï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:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KhhÊh²hubj~)”}”(hŒ'perf report --stdio --dump -i perf.data”h]”hŒ'perf report --stdio --dump -i perf.data”…””}”hj›sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´KhhÊh²hubj)”}”(hŒFYou should find some sections of this file have AUX data blocks like::”h]”hŒEYou should find some sections of this file have AUX data blocks like:”…””}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KhhÊh²hubj~)”}”(hX0x1e78 [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 ...”h]”hX0x1e78 [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 ...”…””}”hj·sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´KhhÊh²hubj)”}”(hŒMIf you see these above, then your system is tracing CoreSight data correctly.”h]”hŒMIf you see these above, then your system is tracing CoreSight data correctly.”…””}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K(hhÊh²hubj)”}”(hŒGTo compile perf with CoreSight support in the tools/perf directory do::”h]”hŒFTo compile perf with CoreSight support in the tools/perf directory do:”…””}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K+hhÊh²hubj~)”}”(hŒmake CORESIGHT=1”h]”hŒmake CORESIGHT=1”…””}”hjásbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´K-hhÊh²hubj)”}”(hŒ¾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:”h]”hŒ¾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:”…””}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K/hhÊh²hubhÞ)”}”(hŒ"https://github.com/Linaro/OpenCSD ”h]”j)”}”(hŒ!https://github.com/Linaro/OpenCSD”h]”j )”}”(hjh]”hŒ!https://github.com/Linaro/OpenCSD”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”juh1j hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K3hjýubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K3hhÊh²hubj)”}”(hŒbFor complete information on building perf with CoreSight support and more extensive usage look at:”h]”hŒbFor complete information on building perf with CoreSight support and more extensive usage look at:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K5hhÊh²hubhÞ)”}”(hŒ8https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md ”h]”j)”}”(hŒ6https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md”h]”j )”}”(hj3h]”hŒ6https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md”…””}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j3uh1j hj1ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K8hj-ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K8hhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒKernel CoreSight Support”h]”hŒKernel CoreSight Support”…””}”(hjRh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjOh²hh³hÇh´KhjOh²hubj~)”}”(hŒCONFIG_CORESIGHT=y”h]”hŒCONFIG_CORESIGHT=y”…””}”hjnsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´KAhjOh²hubj)”}”(hŒOThere are various other CoreSight options you probably also want enabled like::”h]”hŒNThere are various other CoreSight options you probably also want enabled like:”…””}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KChjOh²hubj~)”}”(hŒú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”h]”hŒú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”…””}”hjŠsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´KFhjOh²hubj)”}”(hŒCPlease refer to the kernel configuration help for more information.”h]”hŒCPlease refer to the kernel configuration help for more information.”…””}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KOhjOh²hubeh}”(h]”Œkernel-coresight-support”ah ]”h"]”Œkernel coresight support”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Kstats-asm_pure_loop-out.csv stats-memcpy_thread-16k_10.csv ...”h]”hŒ>stats-asm_pure_loop-out.csv stats-memcpy_thread-16k_10.csv ...”…””}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KŽhjëubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŽhjrh²hubj)”}”(hXá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.”h]”hXã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.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K’hjrh²hubj)”}”(hŒÜ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.”h]”hŒÞ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.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kžhjrh²hubj)”}”(hŒŸ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.”h]”hŒŸ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.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K£hjrh²hubj)”}”(hŒŽYou can change where these csv logs are stored by setting the PERF_TEST_CORESIGHT_STATDIR environment variable before running perf test like::”h]”hŒYou can change where these csv logs are stored by setting the PERF_TEST_CORESIGHT_STATDIR environment variable before running perf test like:”…””}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K§hjrh²hubj~)”}”(hŒ5export PERF_TEST_CORESIGHT_STATDIR=/var/tmp perf test”h]”hŒ5export PERF_TEST_CORESIGHT_STATDIR=/var/tmp perf test”…””}”hj;sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´K«hjrh²hubj)”}”(hŒdThey will also store resulting perf output data in the current directory for later inspection like::”h]”hŒcThey will also store resulting perf output data in the current directory for later inspection like:”…””}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K®hjrh²hubj~)”}”(hŒ>perf-asm_pure_loop-out.data perf-memcpy_thread-16k_10.data ...”h]”hŒ>perf-asm_pure_loop-out.data perf-memcpy_thread-16k_10.data ...”…””}”hjWsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´K±hjrh²hubj)”}”(hŒ|You can alter where the perf data files are stored by setting the PERF_TEST_CORESIGHT_DATADIR environment variable such as::”h]”hŒ{You can alter where the perf data files are stored by setting the PERF_TEST_CORESIGHT_DATADIR environment variable such as:”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kµhjrh²hubj~)”}”(hŒ.PERF_TEST_CORESIGHT_DATADIR=/var/tmp perf test”h]”hŒ.PERF_TEST_CORESIGHT_DATADIR=/var/tmp perf test”…””}”hjssbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j}h³hÇh´K¸hjrh²hubj)”}”(hŒ¯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.”h]”hŒ¯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.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K»hjrh²hubeh}”(h]”Œ9perf-test-verify-kernel-and-userspace-perf-coresight-work”ah ]”h"]”Œ;perf test - verify kernel and userspace perf coresight work”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Kqubeh}”(h]”Œcoresight-perf”ah ]”h"]”Œcoresight - perf”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jÂŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jœj™j«j¨jojlj”j‘uŒ nametypes”}”(jœ‰j«‰jo‰j”‰uh}”(j™hÊj¨jOjlj®j‘jruŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.