o{sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget$/translations/zh_CN/arch/powerpc/imcmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/zh_TW/arch/powerpc/imcmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/it_IT/arch/powerpc/imcmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ja_JP/arch/powerpc/imcmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ko_KR/arch/powerpc/imcmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/sp_SP/arch/powerpc/imcmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh>/var/lib/git/docbuild/linux/Documentation/arch/powerpc/imc.rsthKubhtarget)}(h.. _imc:h]h}(h]h ]h"]h$]h&]refidimcuh1hhKhhhhhhubhsection)}(hhh](htitle)}(h#IMC (In-Memory Collection Counters)h]h#IMC (In-Memory Collection Counters)}(hhhhhNhNubah}(h]h ]h"]h$]h&]hid1uh1hhhhhhhhKubh paragraph)}(hAnju T Sudhakar, 10 May 2019h]hAnju T Sudhakar, 10 May 2019}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhtopic)}(h Contents h](h)}(hContentsh]hContents}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhK ubh bullet_list)}(hhh]h list_item)}(hhh](h)}(hhh]h reference)}(hhh]h#IMC (In-Memory Collection Counters)}(hj hhhNhNubah}(h]hah ]h"]h$]h&]refid!imc-in-memory-collection-countersuh1j hjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](j)}(hhh]h)}(hhh]j )}(hhh]hBasic overview}(hj)hhhNhNubah}(h]id2ah ]h"]h$]h&]refidbasic-overviewuh1j hj&ubah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hhh]j )}(hhh]hIMC example usage}(hjKhhhNhNubah}(h]id3ah ]h"]h$]h&]refidimc-example-usageuh1j hjHubah}(h]h ]h"]h$]h&]uh1hhjEubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](h)}(hhh]j )}(hhh]hIMC Trace-mode}(hjmhhhNhNubah}(h]id4ah ]h"]h$]h&]refidimc-trace-modeuh1j hjjubah}(h]h ]h"]h$]h&]uh1hhjgubh)}(hhh](j)}(hhh]h)}(hhh]j )}(hhh]hLDBAR Register Layout}(hjhhhNhNubah}(h]id5ah ]h"]h$]h&]refidldbar-register-layoutuh1j hjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hhh]j )}(hhh]h!TRACE_IMC_SCOM bit representation}(hjhhhNhNubah}(h]id6ah ]h"]h$]h&]refid!trace-imc-scom-bit-representationuh1j hjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhjgubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hhh]j )}(hhh]hTrace IMC example usage}(hjhhhNhNubah}(h]id7ah ]h"]h$]h&]refidtrace-imc-example-usageuh1j hjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hhh]j )}(hhh]h Benefits of using IMC trace-mode}(hjhhhNhNubah}(h]id8ah ]h"]h$]h&]refid benefits-of-using-imc-trace-modeuh1j hjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1jhhubah}(h]h ]h"]h$]h&]uh1hhhhhhNhNubeh}(h]contentsah ]contentsah"]contentsah$]h&]uh1hhhhK hhhhubh)}(hhh](h)}(hBasic overviewh]hBasic overview}(hj8hhhNhNubah}(h]h ]h"]h$]h&]hj2uh1hhj5hhhhhKubh)}(hIMC (In-Memory collection counters) is a hardware monitoring facility that collects large numbers of hardware performance events at Nest level (these are on-chip but off-core), Core level and Thread level.h]hIMC (In-Memory collection counters) is a hardware monitoring facility that collects large numbers of hardware performance events at Nest level (these are on-chip but off-core), Core level and Thread level.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5hhubh)}(hThe Nest PMU counters are handled by a Nest IMC microcode which runs in the OCC (On-Chip Controller) complex. The microcode collects the counter data and moves the nest IMC counter data to memory.h]hThe Nest PMU counters are handled by a Nest IMC microcode which runs in the OCC (On-Chip Controller) complex. The microcode collects the counter data and moves the nest IMC counter data to memory.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5hhubh)}(hThe Core and Thread IMC PMU counters are handled in the core. Core level PMU counters give us the IMC counters' data per core and thread level PMU counters give us the IMC counters' data per CPU thread.h]hThe Core and Thread IMC PMU counters are handled in the core. Core level PMU counters give us the IMC counters’ data per core and thread level PMU counters give us the IMC counters’ data per CPU thread.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5hhubh)}(hOPAL obtains the IMC PMU and supported events information from the IMC Catalog and passes on to the kernel via the device tree. The event's information contains:h]hOPAL obtains the IMC PMU and supported events information from the IMC Catalog and passes on to the kernel via the device tree. The event’s information contains:}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5hhubh)}(hhh](j)}(h Event nameh]h)}(hjh]h Event name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjubah}(h]h ]h"]h$]h&]uh1jhj~hhhhhNubj)}(h Event Offseth]h)}(hjh]h Event Offset}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK"hjubah}(h]h ]h"]h$]h&]uh1jhj~hhhhhNubj)}(hEvent description h]h)}(hEvent descriptionh]hEvent description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjubah}(h]h ]h"]h$]h&]uh1jhj~hhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1hhhhK!hj5hhubh)}(hand possibly also:h]hand possibly also:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hj5hhubh)}(hhh](j)}(h Event scaleh]h)}(hjh]h Event scale}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h Event unit h]h)}(h Event unith]h Event unit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhK'hj5hhubh)}(hSome PMUs may have a common scale and unit values for all their supported events. For those cases, the scale and unit properties for those events must be inherited from the PMU.h]hSome PMUs may have a common scale and unit values for all their supported events. For those cases, the scale and unit properties for those events must be inherited from the PMU.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hj5hhubh)}(hJThe event offset in the memory is where the counter data gets accumulated.h]hJThe event offset in the memory is where the counter data gets accumulated.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hj5hhubhdefinition_list)}(hhh]hdefinition_list_item)}(hGIMC catalog is available at: https://github.com/open-power/ima-catalog h](hterm)}(hIMC catalog is available at:h]hIMC catalog is available at:}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1j<hhhK1hj8ubh definition)}(hhh]h)}(h)https://github.com/open-power/ima-catalogh]j )}(hjSh]h)https://github.com/open-power/ima-catalog}(hjUhhhNhNubah}(h]h ]h"]h$]h&]refurijSuh1j hjQubah}(h]h ]h"]h$]h&]uh1hhhhK1hjNubah}(h]h ]h"]h$]h&]uh1jLhj8ubeh}(h]h ]h"]h$]h&]uh1j6hhhK1hj3ubah}(h]h ]h"]h$]h&]uh1j1hj5hhhhhNubh)}(hX(The kernel discovers the IMC counters information in the device tree at the `imc-counters` device node which has a compatible field `ibm,opal-in-memory-counters`. From the device tree, the kernel parses the PMUs and their event's information and register the PMU and its attributes in the kernel.h](hLThe kernel discovers the IMC counters information in the device tree at the }(hj{hhhNhNubhtitle_reference)}(h`imc-counters`h]h imc-counters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj{ubh* device node which has a compatible field }(hj{hhhNhNubj)}(h`ibm,opal-in-memory-counters`h]hibm,opal-in-memory-counters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj{ubh. From the device tree, the kernel parses the PMUs and their event’s information and register the PMU and its attributes in the kernel.}(hj{hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK3hj5hhubeh}(h]j8ah ]h"]basic overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hIMC example usageh]hIMC example usage}(hjhhhNhNubah}(h]h ]h"]h$]h&]hjTuh1hhjhhhhhK:ubh literal_block)}(hX# perf list [...] nest_mcs01/PM_MCS01_64B_RD_DISP_PORT01/ [Kernel PMU event] nest_mcs01/PM_MCS01_64B_RD_DISP_PORT23/ [Kernel PMU event] [...] core_imc/CPM_0THRD_NON_IDLE_PCYC/ [Kernel PMU event] core_imc/CPM_1THRD_NON_IDLE_INST/ [Kernel PMU event] [...] thread_imc/CPM_0THRD_NON_IDLE_PCYC/ [Kernel PMU event] thread_imc/CPM_1THRD_NON_IDLE_INST/ [Kernel PMU event]h]hX# perf list [...] nest_mcs01/PM_MCS01_64B_RD_DISP_PORT01/ [Kernel PMU event] nest_mcs01/PM_MCS01_64B_RD_DISP_PORT23/ [Kernel PMU event] [...] core_imc/CPM_0THRD_NON_IDLE_PCYC/ [Kernel PMU event] core_imc/CPM_1THRD_NON_IDLE_INST/ [Kernel PMU event] [...] thread_imc/CPM_0THRD_NON_IDLE_PCYC/ [Kernel PMU event] thread_imc/CPM_1THRD_NON_IDLE_INST/ [Kernel PMU event]}hjsbah}(h]h ]h"]h$]h&]hhforcelanguageshhighlight_args}uh1jhhhK /dev/null [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.012 MB perf.data (21 samples) ]h]h# perf record -e trace_imc/trace_cycles/ yes > /dev/null [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.012 MB perf.data (21 samples) ]}hjesbah}(h]h ]h"]h$]h&]hhjjshj}uh1jhhhKhj6hhubh)}(h9The `perf.data` generated, can be read using perf report.h](hThe }(hjuhhhNhNubj)}(h `perf.data`h]h perf.data}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjuubh* generated, can be read using perf report.}(hjuhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj6hhubeh}(h]jah ]h"]trace imc example usageah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Benefits of using IMC trace-modeh]h Benefits of using IMC trace-mode}(hjhhhNhNubah}(h]h ]h"]h$]h&]hjuh1hhjhhhhhKubh)}(hXPMI (Performance Monitoring Interrupts) interrupt handling is avoided, since IMC trace mode snapshots the program counter and updates to the memory. And this also provide a way for the operating system to do instruction sampling in real time without PMI processing overhead.h]hXPMI (Performance Monitoring Interrupts) interrupt handling is avoided, since IMC trace mode snapshots the program counter and updates to the memory. And this also provide a way for the operating system to do instruction sampling in real time without PMI processing overhead.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hCPerformance data using `perf top` with and without trace-imc event.h](hPerformance data using }(hjhhhNhNubj)}(h `perf top`h]hperf top}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh" with and without trace-imc event.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hQPMI interrupts count when `perf top` command is executed without trace-imc event.h](hPMI interrupts count when }(hjhhhNhNubj)}(h `perf top`h]hperf top}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh- command is executed without trace-imc event.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hX# grep PMI /proc/interrupts PMI: 0 0 0 0 Performance monitoring interrupts # ./perf top ... # grep PMI /proc/interrupts PMI: 39735 8710 17338 17801 Performance monitoring interrupts # ./perf top -e trace_imc/trace_cycles/ ... # grep PMI /proc/interrupts PMI: 39735 8710 17338 17801 Performance monitoring interruptsh]hX# grep PMI /proc/interrupts PMI: 0 0 0 0 Performance monitoring interrupts # ./perf top ... # grep PMI /proc/interrupts PMI: 39735 8710 17338 17801 Performance monitoring interrupts # ./perf top -e trace_imc/trace_cycles/ ... # grep PMI /proc/interrupts PMI: 39735 8710 17338 17801 Performance monitoring interrupts}hjsbah}(h]h ]h"]h$]h&]hhjjshj}uh1jhhhKhjhhubh)}(hTThat is, the PMI interrupt counts do not increment when using the `trace_imc` event.h](hBThat is, the PMI interrupt counts do not increment when using the }(hj hhhNhNubj)}(h `trace_imc`h]h trace_imc}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh event.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]j ah ]h"] benefits of using imc trace-modeah$]h&]uh1hhhhhhhhKubeh}(h](jheh ]h"](#imc (in-memory collection counters)imceh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}j7 hsexpect_referenced_by_id}hhsubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj` error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}h]hasnameids}(j7 hj6 jj2j.jj8j:jZj3j|jijj,jjjj/ j u nametypes}(j7 j6 j2jj:j3jij,jj/ uh}(hhjhj.hj8j5jZjj|j=jjjjjljj6j jhj j2j)jTjKjvjmjjjjjjjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jn KsRparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h)Hyperlink target "imc" is not referenced.}hj sbah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j uba transformerN include_log] decorationNhhub.