€•‡CŒ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”Œ-/translations/zh_CN/admin-guide/perf/hns3-pmu”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/zh_TW/admin-guide/perf/hns3-pmu”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/it_IT/admin-guide/perf/hns3-pmu”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/ja_JP/admin-guide/perf/hns3-pmu”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/ko_KR/admin-guide/perf/hns3-pmu”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/sp_SP/admin-guide/perf/hns3-pmu”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ&HNS3 Performance Monitoring Unit (PMU)”h]”hŒ&HNS3 Performance Monitoring Unit (PMU)”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒG/var/lib/git/docbuild/linux/Documentation/admin-guide/perf/hns3-pmu.rst”h KubhŒ paragraph”“”)”}”(hŒÌHNS3(HiSilicon network system 3) Performance Monitoring Unit (PMU) is an End Point device to collect performance statistics of HiSilicon SoC NIC. On Hip09, each SICL(Super I/O cluster) has one PMU device.”h]”hŒÌHNS3(HiSilicon network system 3) Performance Monitoring Unit (PMU) is an End Point device to collect performance statistics of HiSilicon SoC NIC. On Hip09, each SICL(Super I/O cluster) has one PMU device.”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hŒrHNS3 PMU supports collection of performance statistics such as bandwidth, latency, packet rate and interrupt rate.”h]”hŒrHNS3 PMU supports collection of performance statistics such as bandwidth, latency, packet rate and interrupt rate.”…””}”(hhÇhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hh£hžhubh¸)”}”(hŒ)Each HNS3 PMU supports 8 hardware events.”h]”hŒ)Each HNS3 PMU supports 8 hardware events.”…””}”(hhÕhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hh£hžhubh¢)”}”(hhh]”(h§)”}”(hŒHNS3 PMU driver”h]”hŒHNS3 PMU driver”…””}”(hhæhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhãhžhhŸh¶h Kubh¸)”}”(hŒHThe HNS3 PMU driver registers a perf PMU with the name of its sicl id.::”h]”hŒGThe HNS3 PMU driver registers a perf PMU with the name of its sicl id.:”…””}”(hhôhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhhãhžhubhŒ literal_block”“”)”}”(hŒ5/sys/bus/event_source/devices/hns3_pmu_sicl_”h]”hŒ5/sys/bus/event_source/devices/hns3_pmu_sicl_”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jhŸh¶h Khhãhžhubh¸)”}”(hŒkPMU driver provides description of available events, filter modes, format, identifier and cpumask in sysfs.”h]”hŒkPMU driver provides description of available events, filter modes, format, identifier and cpumask in sysfs.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khhãhžhubh¸)”}”(hŒ[The "events" directory describes the event code of all supported events shown in perf list.”h]”hŒ_The “events†directory describes the event code of all supported events shown in perf list.”…””}”(hj"hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khhãhžhubh¸)”}”(hŒNThe "filtermode" directory describes the supported filter modes of each event.”h]”hŒRThe “filtermode†directory describes the supported filter modes of each event.”…””}”(hj0hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khhãhžhubh¸)”}”(hŒ‰The "format" directory describes all formats of the config (events) and config1 (filter options) fields of the perf_event_attr structure.”h]”hŒThe “format†directory describes all formats of the config (events) and config1 (filter options) fields of the perf_event_attr structure.”…””}”(hj>hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khhãhžhubh¸)”}”(hŒ;The "identifier" file shows version of PMU hardware device.”h]”hŒ?The “identifier†file shows version of PMU hardware device.”…””}”(hjLhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K!hhãhžhubh¸)”}”(hŒRThe "bdf_min" and "bdf_max" files show the supported bdf range of each pmu device.”h]”hŒZThe “bdf_min†and “bdf_max†files show the supported bdf range of each pmu device.”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K#hhãhžhubh¸)”}”(hŒMThe "hw_clk_freq" file shows the hardware clock frequency of each pmu device.”h]”hŒQThe “hw_clk_freq†file shows the hardware clock frequency of each pmu device.”…””}”(hjhhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K&hhãhžhubh¸)”}”(hŒ8Example usage of checking event code and subevent code::”h]”hŒ7Example usage of checking event code and subevent code:”…””}”(hjvhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K)hhãhžhubj)”}”(hŒÏ$# cat /sys/bus/event_source/devices/hns3_pmu_sicl_0/events/dly_tx_normal_to_mac_time config=0x00204 $# cat /sys/bus/event_source/devices/hns3_pmu_sicl_0/events/dly_tx_normal_to_mac_packet_num config=0x10204”h]”hŒÏ$# cat /sys/bus/event_source/devices/hns3_pmu_sicl_0/events/dly_tx_normal_to_mac_time config=0x00204 $# cat /sys/bus/event_source/devices/hns3_pmu_sicl_0/events/dly_tx_normal_to_mac_packet_num config=0x10204”…””}”hj„sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h K+hhãhžhubh¸)”}”(hŒrEach performance statistic has a pair of events to get two values to calculate real performance data in userspace.”h]”hŒrEach performance statistic has a pair of events to get two values to calculate real performance data in userspace.”…””}”(hj’hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K0hhãhžhubh¸)”}”(hŒòThe bits 0~15 of config (here 0x0204) are the true hardware event code. If two events have same value of bits 0~15 of config, that means they are event pair. And the bit 16 of config indicates getting counter 0 or counter 1 of hardware event.”h]”hŒòThe bits 0~15 of config (here 0x0204) are the true hardware event code. If two events have same value of bits 0~15 of config, that means they are event pair. And the bit 16 of config indicates getting counter 0 or counter 1 of hardware event.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K3hhãhžhubh¸)”}”(hŒxAfter getting two values of event pair in userspace, the formula of computation to calculate real performance data is:::”h]”hŒwAfter getting two values of event pair in userspace, the formula of computation to calculate real performance data is::”…””}”(hj®hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K8hhãhžhubj)”}”(hŒcounter 0 / counter 1”h]”hŒcounter 0 / counter 1”…””}”hj¼sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h K;hhãhžhubh¸)”}”(hŒ1Example usage of checking supported filter mode::”h]”hŒ0Example usage of checking supported filter mode:”…””}”(hjÊhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K=hhãhžhubj)”}”(hŒ$# cat /sys/bus/event_source/devices/hns3_pmu_sicl_0/filtermode/bw_ssu_rpu_byte_num filter mode supported: global/port/port-tc/func/func-queue/”h]”hŒ$# cat /sys/bus/event_source/devices/hns3_pmu_sicl_0/filtermode/bw_ssu_rpu_byte_num filter mode supported: global/port/port-tc/func/func-queue/”…””}”hjØsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h K?hhãhžhubh¸)”}”(hŒExample usage of perf::”h]”hŒExample usage of perf:”…””}”(hjæhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KBhhãhžhubj)”}”(hX‘$# perf list hns3_pmu_sicl_0/bw_ssu_rpu_byte_num/ [kernel PMU event] hns3_pmu_sicl_0/bw_ssu_rpu_time/ [kernel PMU event] ------------------------------------------ $# perf stat -g -e hns3_pmu_sicl_0/bw_ssu_rpu_byte_num,global=1/ -e hns3_pmu_sicl_0/bw_ssu_rpu_time,global=1/ -I 1000 or $# perf stat -g -e hns3_pmu_sicl_0/config=0x00002,global=1/ -e hns3_pmu_sicl_0/config=0x10002,global=1/ -I 1000”h]”hX‘$# perf list hns3_pmu_sicl_0/bw_ssu_rpu_byte_num/ [kernel PMU event] hns3_pmu_sicl_0/bw_ssu_rpu_time/ [kernel PMU event] ------------------------------------------ $# perf stat -g -e hns3_pmu_sicl_0/bw_ssu_rpu_byte_num,global=1/ -e hns3_pmu_sicl_0/bw_ssu_rpu_time,global=1/ -I 1000 or $# perf stat -g -e hns3_pmu_sicl_0/config=0x00002,global=1/ -e hns3_pmu_sicl_0/config=0x10002,global=1/ -I 1000”…””}”hjôsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h KDhhãhžhubh¢)”}”(hhh]”(h§)”}”(hŒ Filter modes”h]”hŒ Filter modes”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhžhhŸh¶h KOubh¸)”}”(hŒ«1. global mode PMU collect performance statistics for all HNS3 PCIe functions of IO DIE. Set the "global" filter option to 1 will enable this mode. Example usage of perf::”h]”hŒ®1. global mode PMU collect performance statistics for all HNS3 PCIe functions of IO DIE. Set the “global†filter option to 1 will enable this mode. Example usage of perf:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KQhjhžhubj)”}”(hŒC$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,global=1/ -I 1000”h]”hŒC$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,global=1/ -I 1000”…””}”hj!sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h KVhjhžhubh¸)”}”(hŒÃ2. port mode PMU collect performance statistic of one whole physical port. The port id is same as mac id. The "tc" filter option must be set to 0xF in this mode, here tc stands for traffic class.”h]”hŒÇ2. port mode PMU collect performance statistic of one whole physical port. The port id is same as mac id. The “tc†filter option must be set to 0xF in this mode, here tc stands for traffic class.”…””}”(hj/hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KXhjhžhubh¸)”}”(hŒExample usage of perf::”h]”hŒExample usage of perf:”…””}”(hj=hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K]hjhžhubj)”}”(hŒH$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,port=0,tc=0xF/ -I 1000”h]”hŒH$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,port=0,tc=0xF/ -I 1000”…””}”hjKsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h K_hjhžhubh¸)”}”(hŒ¾3. port-tc mode PMU collect performance statistic of one tc of physical port. The port id is same as mac id. The "tc" filter option must be set to 0 ~ 7 in this mode. Example usage of perf::”h]”hŒÁ3. port-tc mode PMU collect performance statistic of one tc of physical port. The port id is same as mac id. The “tc†filter option must be set to 0 ~ 7 in this mode. Example usage of perf:”…””}”(hjYhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kahjhžhubj)”}”(hŒF$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,port=0,tc=0/ -I 1000”h]”hŒF$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,port=0,tc=0/ -I 1000”…””}”hjgsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h Kghjhžhubh¸)”}”(hŒv4. func mode PMU collect performance statistic of one PF/VF. The function id is BDF of PF/VF, its conversion formula::”h]”hŒu4. func mode PMU collect performance statistic of one PF/VF. The function id is BDF of PF/VF, its conversion formula:”…””}”(hjuhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kihjhžhubj)”}”(hŒ.func = (bus << 8) + (device << 3) + (function)”h]”hŒ.func = (bus << 8) + (device << 3) + (function)”…””}”hjƒsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h KmhjhžhubhŒdefinition_list”“”)”}”(hhh]”hŒdefinition_list_item”“”)”}”(hŒTfor example: BDF func 35:00.0 0x3500 35:00.1 0x3501 35:01.0 0x3508 ”h]”(hŒterm”“”)”}”(hŒ for example:”h]”hŒ for example:”…””}”(hjžhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jœhŸh¶h Kshj˜ubhŒ definition”“”)”}”(hhh]”h¸)”}”(hŒFBDF func 35:00.0 0x3500 35:00.1 0x3501 35:01.0 0x3508”h]”hŒFBDF func 35:00.0 0x3500 35:00.1 0x3501 35:01.0 0x3508”…””}”(hj±hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kphj®ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¬hj˜ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j–hŸh¶h Kshj“ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‘hjhžhhŸh¶h Nubh¸)”}”(hŒVIn this mode, the "queue" filter option must be set to 0xFFFF. Example usage of perf::”h]”hŒYIn this mode, the “queue†filter option must be set to 0xFFFF. Example usage of perf:”…””}”(hjÑhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kuhjhžhubj)”}”(hŒR$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,bdf=0x3500,queue=0xFFFF/ -I 1000”h]”hŒR$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,bdf=0x3500,queue=0xFFFF/ -I 1000”…””}”hjßsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h Kxhjhžhubh¸)”}”(hŒÍ5. func-queue mode PMU collect performance statistic of one queue of PF/VF. The function id is BDF of PF/VF, the "queue" filter option must be set to the exact queue id of function. Example usage of perf::”h]”hŒÐ5. func-queue mode PMU collect performance statistic of one queue of PF/VF. The function id is BDF of PF/VF, the “queue†filter option must be set to the exact queue id of function. Example usage of perf:”…””}”(hjíhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kzhjhžhubj)”}”(hŒM$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,bdf=0x3500,queue=0/ -I 1000”h]”hŒM$# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,bdf=0x3500,queue=0/ -I 1000”…””}”hjûsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h K€hjhžhubh¸)”}”(hŒÓ6. func-intr mode PMU collect performance statistic of one interrupt of PF/VF. The function id is BDF of PF/VF, the "intr" filter option must be set to the exact interrupt id of function. Example usage of perf::”h]”hŒÖ6. func-intr mode PMU collect performance statistic of one interrupt of PF/VF. The function id is BDF of PF/VF, the “intr†filter option must be set to the exact interrupt id of function. Example usage of perf:”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K‚hjhžhubj)”}”(hŒL$# perf stat -a -e hns3_pmu_sicl_0/config=0x00301,bdf=0x3500,intr=0/ -I 1000”h]”hŒL$# perf stat -a -e hns3_pmu_sicl_0/config=0x00301,bdf=0x3500,intr=0/ -I 1000”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h Kˆhjhžhubeh}”(h]”Œ filter-modes”ah ]”h"]”Œ filter modes”ah$]”h&]”uh1h¡hhãhžhhŸh¶h KOubeh}”(h]”Œhns3-pmu-driver”ah ]”h"]”Œhns3 pmu driver”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubeh}”(h]”Œ$hns3-performance-monitoring-unit-pmu”ah ]”h"]”Œ&hns3 performance monitoring unit (pmu)”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:j7j2j/j*j'uŒ nametypes”}”(j:‰j2‰j*‰uh}”(j7h£j/hãj'juŒ 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.