<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/tools/perf/util/expr.c, branch v6.12.80</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>perf expr: Initialize is_test value in expr__ctx_new()</title>
<updated>2025-02-08T08:57:29+00:00</updated>
<author>
<name>Levi Yun</name>
<email>yeoreum.yun@arm.com</email>
</author>
<published>2024-11-08T14:34:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=58ad9c26238f0e9e2a438e70f2cd2a8eaf184f63'/>
<id>58ad9c26238f0e9e2a438e70f2cd2a8eaf184f63</id>
<content type='text'>
[ Upstream commit 1d18ebcfd302a2005b83ae5f13df223894d19902 ]

When expr_parse_ctx is allocated by expr_ctx_new(),
expr_scanner_ctx-&gt;is_test isn't initialize, so it has garbage value.
this can affects the result of expr__parse() return when it parses
non-exist event literal according to garbage value.

Use calloc instead of malloc in expr_ctx_new() to fix this.

Fixes: 3340a08354ac286e ("perf pmu-events: Fix testing with JEVENTS_ARCH=all")
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Levi Yun &lt;yeoreum.yun@arm.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20241108143424.819126-1-yeoreum.yun@arm.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 1d18ebcfd302a2005b83ae5f13df223894d19902 ]

When expr_parse_ctx is allocated by expr_ctx_new(),
expr_scanner_ctx-&gt;is_test isn't initialize, so it has garbage value.
this can affects the result of expr__parse() return when it parses
non-exist event literal according to garbage value.

Use calloc instead of malloc in expr_ctx_new() to fix this.

Fixes: 3340a08354ac286e ("perf pmu-events: Fix testing with JEVENTS_ARCH=all")
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Reviewed-by: James Clark &lt;james.clark@linaro.org&gt;
Signed-off-by: Levi Yun &lt;yeoreum.yun@arm.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20241108143424.819126-1-yeoreum.yun@arm.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf: parse-events: Fix compilation error while defining DEBUG_PARSER</title>
<updated>2024-06-06T07:19:36+00:00</updated>
<author>
<name>Clément Le Goffic</name>
<email>clement.legoffic@foss.st.com</email>
</author>
<published>2024-06-05T14:04:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9aa61d8ecb7f6f176ff8247a41a4f6eea8376112'/>
<id>9aa61d8ecb7f6f176ff8247a41a4f6eea8376112</id>
<content type='text'>
Compiling perf tool with 'DEBUG_PARSER=1' leads to errors:

$&gt; make -C tools/perf PARSER_DEBUG=1 NO_LIBTRACEEVENT=1
...
  CC      util/expr-flex.o
  CC      util/expr.o
util/parse-events.c:33:12: error: redundant redeclaration of ‘parse_events_debug’ [-Werror=redundant-decls]
   33 | extern int parse_events_debug;
      |            ^~~~~~~~~~~~~~~~~~
In file included from util/parse-events.c:18:
util/parse-events-bison.h:43:12: note: previous declaration of ‘parse_events_debug’ with type ‘int’
   43 | extern int parse_events_debug;
      |            ^~~~~~~~~~~~~~~~~~
util/expr.c:27:12: error: redundant redeclaration of ‘expr_debug’ [-Werror=redundant-decls]
   27 | extern int expr_debug;
      |            ^~~~~~~~~~
In file included from util/expr.c:11:
util/expr-bison.h:43:12: note: previous declaration of ‘expr_debug’ with type ‘int’
   43 | extern int expr_debug;
      |            ^~~~~~~~~~
cc-1: all warnings being treated as errors

Remove extern declaration from the parse-envents.c file as there is a
conflict with the ones generated using bison and yacc tools from the file
parse-events.[ly].

Signed-off-by: Clément Le Goffic &lt;clement.legoffic@foss.st.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20240605140453.614862-1-clement.legoffic@foss.st.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Compiling perf tool with 'DEBUG_PARSER=1' leads to errors:

$&gt; make -C tools/perf PARSER_DEBUG=1 NO_LIBTRACEEVENT=1
...
  CC      util/expr-flex.o
  CC      util/expr.o
util/parse-events.c:33:12: error: redundant redeclaration of ‘parse_events_debug’ [-Werror=redundant-decls]
   33 | extern int parse_events_debug;
      |            ^~~~~~~~~~~~~~~~~~
In file included from util/parse-events.c:18:
util/parse-events-bison.h:43:12: note: previous declaration of ‘parse_events_debug’ with type ‘int’
   43 | extern int parse_events_debug;
      |            ^~~~~~~~~~~~~~~~~~
util/expr.c:27:12: error: redundant redeclaration of ‘expr_debug’ [-Werror=redundant-decls]
   27 | extern int expr_debug;
      |            ^~~~~~~~~~
In file included from util/expr.c:11:
util/expr-bison.h:43:12: note: previous declaration of ‘expr_debug’ with type ‘int’
   43 | extern int expr_debug;
      |            ^~~~~~~~~~
cc-1: all warnings being treated as errors

Remove extern declaration from the parse-envents.c file as there is a
conflict with the ones generated using bison and yacc tools from the file
parse-events.[ly].

Signed-off-by: Clément Le Goffic &lt;clement.legoffic@foss.st.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20240605140453.614862-1-clement.legoffic@foss.st.com
</pre>
</div>
</content>
</entry>
<entry>
<title>perf expr: Fix "has_event" function for metric style events</title>
<updated>2024-02-13T21:48:06+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2024-02-09T20:49:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=6dd76680b925228312756c13b9b983661b552a64'/>
<id>6dd76680b925228312756c13b9b983661b552a64</id>
<content type='text'>
Events in metrics cannot use '/' as a separator, it would be
recognized as a divide, so they use '@'. The '@' is recognized in the
metricgroups code and changed to '/', do the same in the has_event
function so that the parsing is only tried without the @s.

Fixes: 4a4a9bf9075f ("perf expr: Add has_event function")
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: K Prateek Nayak &lt;kprateek.nayak@amd.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: Kaige Ye &lt;ye@kaige.org&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20240209204947.3873294-3-irogers@google.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Events in metrics cannot use '/' as a separator, it would be
recognized as a divide, so they use '@'. The '@' is recognized in the
metricgroups code and changed to '/', do the same in the has_event
function so that the parsing is only tried without the @s.

Fixes: 4a4a9bf9075f ("perf expr: Add has_event function")
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: K Prateek Nayak &lt;kprateek.nayak@amd.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: Kaige Ye &lt;ye@kaige.org&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lore.kernel.org/r/20240209204947.3873294-3-irogers@google.com
</pre>
</div>
</content>
</entry>
<entry>
<title>perf pmu: Move pmu__find_core_pmu() to pmus.c</title>
<updated>2023-09-15T23:46:40+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@arm.com</email>
</author>
<published>2023-09-13T15:33:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=3d0f5f456a5786573ba6a3358178c8db580e4b85'/>
<id>3d0f5f456a5786573ba6a3358178c8db580e4b85</id>
<content type='text'>
pmu__find_core_pmu() more logically belongs in pmus.c because it
iterates over all PMUs, so move it to pmus.c

At the same time rename it to perf_pmus__find_core_pmu() to match the
naming convention in this file.

list_prepare_entry() can't be used in perf_pmus__scan_core() anymore now
that it's called from the same compilation unit. This is with -O2
(specifically -O1 -ftree-vrp -finline-functions
-finline-small-functions) which allow the bounds of the array
access to be determined at compile time. list_prepare_entry() subtracts
the offset of the 'list' member in struct perf_pmu from &amp;core_pmus,
which isn't a struct perf_pmu. The compiler sees that pmu results in
&amp;core_pmus - 8 and refuses to compile. At runtime this works because
list_for_each_entry_continue() always adds the offset back again before
dereferencing -&gt;next, but it's technically undefined behavior. With
-fsanitize=undefined an additional warning is generated.

Using list_first_entry_or_null() to get the first entry here avoids
doing &amp;core_pmus - 8 but has the same result and fixes both the compile
warning and the undefined behavior warning. There are other uses of
list_prepare_entry() in pmus.c, but the compiler doesn't seem to be
able to see that they can also be called with &amp;core_pmus, so I won't
change any at this time.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Ravi Bangoria &lt;ravi.bangoria@amd.com&gt;
Cc: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Leo Yan &lt;leo.yan@linaro.org&gt;
Cc: Mike Leach &lt;mike.leach@linaro.org&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Haixin Yu &lt;yuhaixin.yhx@linux.alibaba.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230913153355.138331-2-james.clark@arm.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pmu__find_core_pmu() more logically belongs in pmus.c because it
iterates over all PMUs, so move it to pmus.c

At the same time rename it to perf_pmus__find_core_pmu() to match the
naming convention in this file.

list_prepare_entry() can't be used in perf_pmus__scan_core() anymore now
that it's called from the same compilation unit. This is with -O2
(specifically -O1 -ftree-vrp -finline-functions
-finline-small-functions) which allow the bounds of the array
access to be determined at compile time. list_prepare_entry() subtracts
the offset of the 'list' member in struct perf_pmu from &amp;core_pmus,
which isn't a struct perf_pmu. The compiler sees that pmu results in
&amp;core_pmus - 8 and refuses to compile. At runtime this works because
list_for_each_entry_continue() always adds the offset back again before
dereferencing -&gt;next, but it's technically undefined behavior. With
-fsanitize=undefined an additional warning is generated.

Using list_first_entry_or_null() to get the first entry here avoids
doing &amp;core_pmus - 8 but has the same result and fixes both the compile
warning and the undefined behavior warning. There are other uses of
list_prepare_entry() in pmus.c, but the compiler doesn't seem to be
able to see that they can also be called with &amp;core_pmus, so I won't
change any at this time.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: Ian Rogers &lt;irogers@google.com&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Ravi Bangoria &lt;ravi.bangoria@amd.com&gt;
Cc: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: Leo Yan &lt;leo.yan@linaro.org&gt;
Cc: Mike Leach &lt;mike.leach@linaro.org&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Haixin Yu &lt;yuhaixin.yhx@linux.alibaba.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230913153355.138331-2-james.clark@arm.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf metric: Add #num_cpus_online literal</title>
<updated>2023-08-31T02:03:03+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2023-08-30T07:30:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=f0005f1732245533f0bfa5bad4803c30a0e9f4e0'/>
<id>f0005f1732245533f0bfa5bad4803c30a0e9f4e0</id>
<content type='text'>
Returns the number of CPUs online, unlike #num_cpus that returns the
number present.

Add a test of the property.

This will be used in future Intel metrics.

Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Perry Taylor &lt;perry.taylor@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lore.kernel.org/lkml/20230830073026.1829912-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Returns the number of CPUs online, unlike #num_cpus that returns the
number present.

Add a test of the property.

This will be used in future Intel metrics.

Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Cc: James Clark &lt;james.clark@arm.com&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Perry Taylor &lt;perry.taylor@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lore.kernel.org/lkml/20230830073026.1829912-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf jevents: Add a new expression builtin strcmp_cpuid_str()</title>
<updated>2023-08-17T17:12:14+00:00</updated>
<author>
<name>James Clark</name>
<email>james.clark@arm.com</email>
</author>
<published>2023-08-16T11:47:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=9d5da30e4ae9910ed5dd15636534a22a46f0066f'/>
<id>9d5da30e4ae9910ed5dd15636534a22a46f0066f</id>
<content type='text'>
This will allow writing formulas that are conditional on a specific
CPU type or CPU version. It calls through to the existing
strcmp_cpuid_str() function in Perf which has a default weak version,
and an arch specific version for x86 and arm64.

The function takes an 'ID' type value, which is a string. But in this
case Arm CPU IDs are hex numbers prefixed with '0x'. metric.py
assumes strings are only used by event names, and that they can't start
with a number ('0'), so an additional change has to be made to the
regex to convert hex numbers back to 'ID' types.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Cc: Haixin Yu &lt;yuhaixin.yhx@linux.alibaba.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Leo Yan &lt;leo.yan@linaro.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Mike Leach &lt;mike.leach@linaro.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Nick Forrington &lt;nick.forrington@arm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Sohom Datta &lt;sohomdatta1@gmail.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230816114841.1679234-5-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will allow writing formulas that are conditional on a specific
CPU type or CPU version. It calls through to the existing
strcmp_cpuid_str() function in Perf which has a default weak version,
and an arch specific version for x86 and arm64.

The function takes an 'ID' type value, which is a string. But in this
case Arm CPU IDs are hex numbers prefixed with '0x'. metric.py
assumes strings are only used by event names, and that they can't start
with a number ('0'), so an additional change has to be made to the
regex to convert hex numbers back to 'ID' types.

Signed-off-by: James Clark &lt;james.clark@arm.com&gt;
Reviewed-by: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Cc: Haixin Yu &lt;yuhaixin.yhx@linux.alibaba.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Leo Yan &lt;leo.yan@linaro.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Mike Leach &lt;mike.leach@linaro.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Nick Forrington &lt;nick.forrington@arm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Sohom Datta &lt;sohomdatta1@gmail.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230816114841.1679234-5-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf build: Include generated header files properly</title>
<updated>2023-08-03T20:01:24+00:00</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@kernel.org</email>
</author>
<published>2023-07-28T02:24:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=c7e97f215a4ad634b746804679f5937d25f77e29'/>
<id>c7e97f215a4ad634b746804679f5937d25f77e29</id>
<content type='text'>
The flex and bison generate header files from the source.  When user
specified a build directory with O= option, it'd generate files under
the directory.  The build command has -I option to specify the header
include directory.

But the -I option only affects the files included like &lt;...&gt;.  Let's
change the flex and bison headers to use it instead of "...".

Fixes: 80eeb67fe577aa76 ("perf jevents: Program to convert JSON file")
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Anup Sharma &lt;anupnewsmail@gmail.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230728022447.1323563-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The flex and bison generate header files from the source.  When user
specified a build directory with O= option, it'd generate files under
the directory.  The build command has -I option to specify the header
include directory.

But the -I option only affects the files included like &lt;...&gt;.  Let's
change the flex and bison headers to use it instead of "...".

Fixes: 80eeb67fe577aa76 ("perf jevents: Program to convert JSON file")
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Anup Sharma &lt;anupnewsmail@gmail.com&gt;
Cc: Ian Rogers &lt;irogers@google.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230728022447.1323563-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf expr: Add has_event function</title>
<updated>2023-06-30T05:13:15+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2023-06-23T15:10:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=4a4a9bf9075fbc753ab20f05347fd1482d4801e4'/>
<id>4a4a9bf9075fbc753ab20f05347fd1482d4801e4</id>
<content type='text'>
Some events are dependent on firmware/kernel enablement. Allow such
events to be detected when the metric is parsed so that the metric's
event parsing doesn't fail.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Cc: Sohom Datta &lt;sohomdatta1@gmail.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Caleb Biggers &lt;caleb.biggers@intel.com&gt;
Cc: Edward Baker &lt;edward.baker@intel.com&gt;
Cc: Perry Taylor &lt;perry.taylor@intel.com&gt;
Cc: Samantha Alt &lt;samantha.alt@intel.com&gt;
Cc: Weilin Wang &lt;weilin.wang@intel.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Zhengjun Xing &lt;zhengjun.xing@linux.intel.com&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Link: https://lore.kernel.org/r/20230623151016.4193660-2-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some events are dependent on firmware/kernel enablement. Allow such
events to be detected when the metric is parsed so that the metric's
event parsing doesn't fail.

Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Tested-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Cc: Sohom Datta &lt;sohomdatta1@gmail.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Caleb Biggers &lt;caleb.biggers@intel.com&gt;
Cc: Edward Baker &lt;edward.baker@intel.com&gt;
Cc: Perry Taylor &lt;perry.taylor@intel.com&gt;
Cc: Samantha Alt &lt;samantha.alt@intel.com&gt;
Cc: Weilin Wang &lt;weilin.wang@intel.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Jing Zhang &lt;renyu.zj@linux.alibaba.com&gt;
Cc: Kajol Jain &lt;kjain@linux.ibm.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Zhengjun Xing &lt;zhengjun.xing@linux.intel.com&gt;
Cc: John Garry &lt;john.g.garry@oracle.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Link: https://lore.kernel.org/r/20230623151016.4193660-2-irogers@google.com
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf expr: Use zfree() to reduce chances of use after free</title>
<updated>2023-04-12T13:06:11+00:00</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2023-04-12T12:50:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=a77f8184a07cbe81cdee30582640ed1b412705fc'/>
<id>a77f8184a07cbe81cdee30582640ed1b412705fc</id>
<content type='text'>
Do defensive programming by using zfree() to initialize freed pointers
to NULL, so that eventual use after free result in a NULL pointer deref
instead of more subtle behaviour.

Also remove one NULL test before free(), as it accepts a NULL arg and we
get one line shaved not doing it explicitely.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do defensive programming by using zfree() to initialize freed pointers
to NULL, so that eventual use after free result in a NULL pointer deref
instead of more subtle behaviour.

Also remove one NULL test before free(), as it accepts a NULL arg and we
get one line shaved not doing it explicitely.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf metrics: Add has_pmem literal</title>
<updated>2023-04-04T12:39:55+00:00</updated>
<author>
<name>Ian Rogers</name>
<email>irogers@google.com</email>
</author>
<published>2023-03-24T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=c3bf86f11dc9a11afb83b33f9640bf86adfb1b28'/>
<id>c3bf86f11dc9a11afb83b33f9640bf86adfb1b28</id>
<content type='text'>
Add literal so that if nvdimms aren't installed we can record fewer
events.  The file detection mechanism was suggested by Dan Williams
&lt;dan.j.williams@intel.com&gt; in:

  https://lore.kernel.org/linux-perf-users/641bbe1eced26_1b98bb29440@dwillia2-xfh.jf.intel.com.notmuch/

Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Caleb Biggers &lt;caleb.biggers@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Edward Baker &lt;edward.baker@intel.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Perry Taylor &lt;perry.taylor@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Samantha Alt &lt;samantha.alt@intel.com&gt;
Cc: Weilin Wang &lt;weilin.wang@intel.com&gt;
Cc: Xing Zhengjun &lt;zhengjun.xing@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230324072218.181880-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add literal so that if nvdimms aren't installed we can record fewer
events.  The file detection mechanism was suggested by Dan Williams
&lt;dan.j.williams@intel.com&gt; in:

  https://lore.kernel.org/linux-perf-users/641bbe1eced26_1b98bb29440@dwillia2-xfh.jf.intel.com.notmuch/

Reviewed-by: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Signed-off-by: Ian Rogers &lt;irogers@google.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Caleb Biggers &lt;caleb.biggers@intel.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Edward Baker &lt;edward.baker@intel.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Mark Rutland &lt;mark.rutland@arm.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Perry Taylor &lt;perry.taylor@intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Samantha Alt &lt;samantha.alt@intel.com&gt;
Cc: Weilin Wang &lt;weilin.wang@intel.com&gt;
Cc: Xing Zhengjun &lt;zhengjun.xing@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230324072218.181880-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
