Skip to content
  1. Sep 05, 2023
  2. Sep 02, 2023
    • Ian Rogers's avatar
      perf parse-events: Fixes relating to no_value terms · 9ea150a8
      Ian Rogers authored
      A term may have no value in which case it is assumed to have a value
      of 1. It doesn't just apply to alias/event terms so change the
      parse_events_term__to_strbuf assert.
      
      Commit 99e7138e ("perf tools: Fail on using multiple bits long
      terms without value") made it so that no_value terms could only be for a
      single bit. Prior to commit 64199ae4 ("perf parse-events: Fix
      propagation of term's no_value when cloning") this missed a test case
      where config1 had no_value.
      
      Fixes: 64199ae4
      
       ("perf parse-events: Fix propagation of term's no_value when cloning")
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230901233949.2930562-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ea150a8
  3. Sep 01, 2023
    • Ian Rogers's avatar
      perf parse-events: Fix propagation of term's no_value when cloning · 64199ae4
      Ian Rogers authored
      The no_value field in 'struct parse_events_term' indicates that the val
      variable isn't used, the case for an event name.
      
      Cloning wasn't propagating this, making cloned event name terms
      appearing to have a constant assinged to them.
      
      Working around the bug would check for a value of 1 assigned to value,
      but then this meant a user value of 1 couldn't be differentiated causing
      the value to be lost in debug printing and perf list.
      
      The change fixes the cloning and updates the "val.num ==/!= 1" tests to
      use no_value instead.
      
      To better check the no_value is set appropriately parameter comments are
      added for constant values.
      
      This found that no_value wasn't set correctly in parse_events_multi_pmu_add,
      which matters now that no_value is used to indicate an event name.
      
      Fixes: 7a6e9164 ("perf parse-events: Make common term list to strbuf helper")
      Fixes: 99e7138e
      
       ("perf tools: Fail on using multiple bits long terms without value")
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230831071421.2201358-4-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      64199ae4
    • Ian Rogers's avatar
      perf parse-events: Name the two term enums · 58d3a4ce
      Ian Rogers authored
      
      
      Name the enums used by 'struct parse_events_term' to
      parse_events__term_val_type and parse_events__term_type.
      
      This allows greater compile time error checking.
      
      Fix -Wswitch related issues by explicitly listing all enum values prior
      to default.
      
      Add config_term_name to safely look up a parse_events__term_type name,
      bounds checking the array access first.
      
      Add documentation to 'struct parse_events_terms' and reorder to save
      space.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230831071421.2201358-3-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      58d3a4ce
    • Ian Rogers's avatar
      perf list: Don't print Unit for "default_core" · 478c3f5d
      Ian Rogers authored
      "default_core" was added as a way to demark JSON events whose PMU should
      be whatever the default core PMU is, previously this had been assumed to
      be "cpu" but that fails on s390 and ARM.
      
      'perf list' displays the PMU in the event description to save storing it
      in JSON, but was still comparing against "cpu" and not "default_core",
      so update this.
      
      Fixes: d2045f87
      
       ("perf jevents: Use "default_core" for events with no Unit")
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230831071421.2201358-2-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      478c3f5d
  4. Aug 31, 2023
  5. Aug 30, 2023
  6. Aug 25, 2023
    • Kajol Jain's avatar
      perf lock contention: Fix typo in max-stack option description · 0f2418fd
      Kajol Jain authored
      
      
      Fix typo in max-stack option description by changing lopck contention
      to lock contention.
      
      Signed-off-by: default avatarKajol Jain <kjain@linux.ibm.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Disha Goel <disgoel@linux.ibm.com>
      Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20230825104700.440809-1-kjain@linux.ibm.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0f2418fd
    • Ian Rogers's avatar
      perf tui slang: Tidy casts · 520da457
      Ian Rogers authored
      
      
      Casts were necessary for older versions of libslang, however, these
      are now 15 years old and so we no longer need to care about supporting
      them. Tidy the casts and remove unnecessary logic.
      
      Move the ENABLE_SLFUTURE_CONST to the libslang.h common include file,
      and also enable ENABLE_SLFUTURE_VOID.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Ming Wang <wangming01@loongson.cn>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Wei Li <liwei391@huawei.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230825024002.801955-7-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      520da457
    • Ian Rogers's avatar
      perf build-id: Simplify build_id_cache__cachedir() · 7512e969
      Ian Rogers authored
      
      
      Initialize realname to NULL, rather than name.
      
      This avoids a cast and as realpath is either NULL or an allocated
      string, free can be called unconditionally.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Ming Wang <wangming01@loongson.cn>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Wei Li <liwei391@huawei.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230825024002.801955-6-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7512e969
    • Ian Rogers's avatar
      perf pmu: Make id const and add missing free · b7823045
      Ian Rogers authored
      
      
      The struct pmu id is initialized from pmu_id that is read into allocated
      memory from a file, as such it needs free-ing in pmu__delete().
      
      Make the id value const so that we can remove casts in tests.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Ming Wang <wangming01@loongson.cn>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Wei Li <liwei391@huawei.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230825024002.801955-5-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b7823045
    • Ian Rogers's avatar
      perf parse-events: Make term's config const · 970ef02e
      Ian Rogers authored
      
      
      This avoids casts in tests. Use zfree in a few places to avoid
      warnings about a freeing a const pointer.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Ming Wang <wangming01@loongson.cn>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Wei Li <liwei391@huawei.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230825024002.801955-4-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      970ef02e
    • Ian Rogers's avatar
      perf pmu: Remove logic for PMU name being NULL · c091ee90
      Ian Rogers authored
      
      
      The PMU name could be NULL in the case of the fake_pmu. Initialize the
      name for the fake_pmu to "fake" so that all other logic can assume it
      is initialized. Add a const to the type of name so that a literal can
      be used to avoid additional initialization code. Propagate the cost
      through related routines and remove now unnecessary "(char *)"
      casts. Doing this located a bug in builtin-list for the pmu_glob that
      was missing a strdup.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Link: https://lore.kernel.org/r/20230825024002.801955-3-irogers@google.com
      
      
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Wei Li <liwei391@huawei.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Ming Wang <wangming01@loongson.cn>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-perf-users@vger.kernel.org
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c091ee90
    • Ian Rogers's avatar
      perf header: Fix missing PMU caps · 9897009e
      Ian Rogers authored
      PMU caps are written as HEADER_PMU_CAPS or for the special case of the
      PMU "cpu" as HEADER_CPU_PMU_CAPS. As the PMU "cpu" is special, and not
      any "core" PMU, the logic had become broken and core PMUs not called
      "cpu" were not having their caps written.
      
      This affects ARM and s390 non-hybrid PMUs.
      
      Simplify the PMU caps writing logic to scan one fewer time and to be
      more explicit in its behavior.
      
      Fixes: 178ddf3b
      
       ("perf header: Avoid hybrid PMU list in write_pmu_caps")
      Reported-by: default avatarWei Li <liwei391@huawei.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: K Prateek Nayak <kprateek.nayak@amd.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Ming Wang <wangming01@loongson.cn>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Sean Christopherson <seanjc@google.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230825024002.801955-2-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9897009e
    • Ian Rogers's avatar
      perf jevents: Don't append Unit to desc · eeb6b129
      Ian Rogers authored
      
      
      Unit with the PMU name is appended to desc in jevents.py, but on
      hybrid platforms it causes the desc to differ from the regular
      non-hybrid system with a PMU of 'cpu'. Having differing descs means
      the events don't deduplicate. To make the perf list output not differ,
      append the Unit on again in the perf list printing code.
      
      On x86 reduces the binary size by 409,600 bytes or about 4%. Update
      pmu-events test expectations to match the differently generated
      pmu-events.c code.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230824183212.374787-1-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      eeb6b129
    • Anup Sharma's avatar
      perf scripts python gecko: Launch the profiler UI on the default browser with the appropriate URL · f208b2c6
      Anup Sharma authored
      
      
      All required libraries have been imported and make sure that none of
      them are external dependencies. To achieve this, created a virt env and
      verified.
      
      Modified usage information and added combined command.
      
      Modified the main() function to read the --save-only command-line option
      and set the output_file variable accordingly.
      
      Modified the trace_end() function to check for the output_file variable.
      If it is set, the profiler data is saved to a local file in Gecko
      Profile format, or the profiler.firefox.com is opened on the default
      browser.
      
      Included trace_begin() to initialize the Firefox Profiler and launch the
      default browser to display the profiler.firefox.com.
      
      Added a new function launchFirefox() to start a local server and launch
      the profiler UI on the default browser with the appropriate URL.
      
      Created the "CORSRequestHandler" class to enable Cross-Origin Resource
      Sharing.
      
      Summary:
      
      This integration now includes a exiting feature to conveniently host the
      Gecko Profile data on a local server and open it directly in the default
      web browser.
      
      This means that users can now effortlessly visualize and analyze the
      profiler results with just a single click.
      
      The addition of the --save-only command-line option allows users to save
      the profiler output to a local file in Gecko Profile format, but the
      real highlight lies in the capability to seamlessly launch a local
      server, making the data accessible to Firefox Profiler via a web
      browser.
      
      In addition, it's important to highlight that all data are hosted
      locally, eliminating any concerns about data privacy rules and
      regulations.
      
      Signed-off-by: default avatarAnup Sharma <anupnewsmail@gmail.com>
      Tested-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/ZNOS0vo58DnVLpD8@yoga
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f208b2c6
    • Anup Sharma's avatar
      perf scripts python: Add support for input args in gecko script · 43803cb1
      Anup Sharma authored
      
      
      Refines the argument handling mechanism in the "gecko-report" script to
      enable better compatibility and improved user experience.
      
      The script now differentiates between scenarios where arguments are
      provided for record and report cases where gecko.py arguments are
      passed.
      
      Signed-off-by: default avatarAnup Sharma <anupnewsmail@gmail.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/ZNf7W+EIrrCSHZN0@yoga
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      43803cb1
  7. Aug 24, 2023
    • Ian Rogers's avatar
      perf jevents: Sort strings in the big C string to reduce faults · f85d120c
      Ian Rogers authored
      
      
      Sort the strings within the big C string based on whether they were
      for a metric and then by when they were added. This helps group
      related strings and reduce minor faults by approximately 10 in 1740,
      about 0.57%.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230824041330.266337-18-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f85d120c
    • Ian Rogers's avatar
      perf pmu: Lazily load sysfs aliases · 8d4b6d37
      Ian Rogers authored
      
      
      Don't load sysfs aliases for a PMU when the PMU is first created, defer
      until an alias needs to be found. For the pmu-scan benchmark, average
      core PMU scanning is reduced by 30.8%, and average PMU scanning by
      12.6%.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230824041330.266337-17-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8d4b6d37
    • Ian Rogers's avatar
      perf pmu: Be lazy about loading event info files from sysfs · 7b723dbb
      Ian Rogers authored
      
      
      Event info is only needed when an event is parsed or when merging data
      from an JSON and sysfs event. Be lazy in its loading to reduce file
      accesses.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230824041330.266337-16-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7b723dbb
    • Ian Rogers's avatar
      perf pmu: Scan type early to fail an invalid PMU quickly · 88ed9184
      Ian Rogers authored
      
      
      Scan sysfs PMU's type early so that format and aliases aren't
      attempted to be loaded if the PMU name is invalid.
      
      This is the case for event_pmu tokens in parse-events.y where a wildcard
      name is first assumed to be a PMU name.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230824041330.266337-15-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      88ed9184
    • Ian Rogers's avatar
      perf pmu: Lazily add JSON events · e6ff1eed
      Ian Rogers authored
      
      
      Rather than scanning all JSON events and adding them when a PMU is
      created, add the alias when the JSON event is needed.
      
      Average core PMU scanning run time reduced by 60.2%. Average PMU
      scanning run time reduced by 15%. Page faults with no events reduced by
      74 page faults, 4% of total.
      
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Link: https://lore.kernel.org/r/20230824041330.266337-14-irogers@google.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e6ff1eed