Skip to content

Commit

Permalink
perf script: Fix documented const'ness of perf_dlfilter_fns
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Fixes: 8defa7147d5572 ("perf script Add API for filtering via dynamically loaded shared object")
Link: https //lore.kernel.org/r/20210811101036.17986-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Adrian Hunter authored and Arnaldo Carvalho de Melo committed Aug 11, 2021
1 parent c4ad8fa commit 988db17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/perf/Documentation/perf-dlfilter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 988db17

Please sign in to comment.