€•þTŒ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Œ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”“”)”}”(hhíh]”(hŒCarsten Haitzler <”…””}”(hhñhžhhŸNh NubhŒ reference”“”)”}”(hŒcarsten.haitzler@arm.com”h]”hŒcarsten.haitzler@arm.com”…””}”(hhúhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:carsten.haitzler@arm.com”uh1høhhñubhŒ>”…””}”(hhñhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸ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”…””}”(hj#hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÙhj hŸh³h Kubhê)”}”(hŒJune 29th, 2022 ”h]”hð)”}”(hŒJune 29th, 2022”h]”hŒJune 29th, 2022”…””}”(hj5hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Khj1ubah}”(h]”h ]”h"]”h$]”h&]”uh1héhj ubeh}”(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žhubhð)”}”(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:”…””}”(hj[hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸ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”…””}”hjksbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jihŸh³h Khh¶hžhubhð)”}”(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:”…””}”(hjyhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Khh¶hžhubjj)”}”(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²uh1jihŸh³h Khh¶hžhubhð)”}”(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&]”uh1hïhŸh³h Khh¶hžhubjj)”}”(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²uh1jihŸh³h Khh¶hžhubhð)”}”(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&]”uh1hïhŸh³h K(hh¶hžhubhð)”}”(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&]”uh1hïhŸh³h K+hh¶hžhubjj)”}”(hŒmake CORESIGHT=1”h]”hŒmake CORESIGHT=1”…””}”hjÍsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jihŸh³h K-hh¶hžhubhð)”}”(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&]”uh1hïhŸh³h K/hh¶hžhubhÊ)”}”(hŒ"https://github.com/Linaro/OpenCSD ”h]”hð)”}”(hŒ!https://github.com/Linaro/OpenCSD”h]”hù)”}”(hjïh]”hŒ!https://github.com/Linaro/OpenCSD”…””}”(hjñhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jïuh1høhjíubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h K3hjéubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K3hh¶hžhubhð)”}”(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:”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h K5hh¶hžhubhÊ)”}”(hŒ8https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md ”h]”hð)”}”(hŒ6https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md”h]”hù)”}”(hjh]”hŒ6https://github.com/Linaro/OpenCSD/blob/master/HOWTO.md”…””}”(hj!hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”juh1høhjubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h K8hjubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K8hh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒKernel CoreSight Support”h]”hŒKernel CoreSight Support”…””}”(hj>hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj;hžhhŸh³h Khj;hžhubjj)”}”(hŒCONFIG_CORESIGHT=y”h]”hŒCONFIG_CORESIGHT=y”…””}”hjZsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jihŸh³h KAhj;hžhubhð)”}”(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:”…””}”(hjhhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h KChj;hžhubjj)”}”(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”…””}”hjvsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jihŸh³h KFhj;hžhubhð)”}”(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&]”uh1hïhŸh³h KOhj;hž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 ...”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Kohjubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Kohjšhžhubhð)”}”(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.”…””}”(hj+hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Kshjšhžhubhð)”}”(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.”…””}”(hj9hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Khjšhžhubhð)”}”(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.”…””}”(hjGhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h K„hjšhžhubhð)”}”(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:”…””}”(hjUhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Kˆhjšhžhubjj)”}”(hŒ5export PERF_TEST_CORESIGHT_STATDIR=/var/tmp perf test”h]”hŒ5export PERF_TEST_CORESIGHT_STATDIR=/var/tmp perf test”…””}”hjcsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jihŸh³h KŒhjšhžhubhð)”}”(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:”…””}”(hjqhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Khjšhžhubjj)”}”(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 ...”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jihŸh³h K’hjšhžhubhð)”}”(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:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h K–hjšhžhubjj)”}”(hŒ.PERF_TEST_CORESIGHT_DATADIR=/var/tmp perf test”h]”hŒ.PERF_TEST_CORESIGHT_DATADIR=/var/tmp perf test”…””}”hj›sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jihŸh³h K™hjšhžhubhð)”}”(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.”…””}”(hj©hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Kœhjšhž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 KRubeh}”(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”j¼j¹uŒ nametypes”}”(jĉj—‰j¼‰uh}”(jÁh¶j”j;j¹jšuŒ 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.