[PATCH V2 1/6] perf script: Fix documented const'ness of perf_dlfilter_fns

From: Adrian Hunter
Date: Wed Aug 11 2021 - 06:10:30 EST


perf_dlfilter_fns must not be const, because it is not. Declaring it
const can result in it being mapped read-only, causing a segfaullt when
it is written. Update documentation accordingly.

Fixes: 8defa7147d5572 ("perf script: Add API for filtering via dynamically loaded shared object")
Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
tools/perf/Documentation/perf-dlfilter.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-dlfilter.txt b/tools/perf/Documentation/perf-dlfilter.txt
index 02842cb4cf90..ece07509d1f7 100644
--- a/tools/perf/Documentation/perf-dlfilter.txt
+++ b/tools/perf/Documentation/perf-dlfilter.txt
@@ -32,7 +32,7 @@ The API for filtering consists of the following:
----
#include <perf/perf_dlfilter.h>

-const struct perf_dlfilter_fns perf_dlfilter_fns;
+struct perf_dlfilter_fns perf_dlfilter_fns;

int start(void **data, void *ctx);
int stop(void *data, void *ctx);
@@ -214,7 +214,7 @@ Filter out everything except branches from "foo" to "bar":
#include <perf/perf_dlfilter.h>
#include <string.h>

-const struct perf_dlfilter_fns perf_dlfilter_fns;
+struct perf_dlfilter_fns perf_dlfilter_fns;

int filter_event(void *data, const struct perf_dlfilter_sample *sample, void *ctx)
{
--
2.17.1