]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf annotate: Fix build with NO_SLANG=1
authorNamhyung Kim <namhyung@kernel.org>
Tue, 21 Oct 2025 03:07:50 +0000 (12:07 +0900)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 21 Oct 2025 12:36:02 +0000 (05:36 -0700)
The recent change for perf c2c annotate broke build without slang
support like below.

  builtin-annotate.c: In function 'hists__find_annotations':
  builtin-annotate.c:522:73: error: 'NO_ADDR' undeclared (first use in this function); did you mean 'NR_ADDR'?
    522 |                         key = hist_entry__tui_annotate(he, evsel, NULL, NO_ADDR);
        |                                                                         ^~~~~~~
        |                                                                         NR_ADDR
  builtin-annotate.c:522:73: note: each undeclared identifier is reported only once for each function it appears in

  builtin-annotate.c:522:31: error: too many arguments to function 'hist_entry__tui_annotate'
    522 |                         key = hist_entry__tui_annotate(he, evsel, NULL, NO_ADDR);
        |                               ^~~~~~~~~~~~~~~~~~~~~~~~
  In file included from util/sort.h:6,
                   from builtin-annotate.c:28:
  util/hist.h:756:19: note: declared here
    756 | static inline int hist_entry__tui_annotate(struct hist_entry *he __maybe_unused,
        |                   ^~~~~~~~~~~~~~~~~~~~~~~~

And I noticed that it missed to update the other side of #ifdef
HAVE_SLANG_SUPPORT.  Let's fix it.

Cc: Tianyou Li <tianyou.li@intel.com>
Fixes: cd3466cd2639783d ("perf c2c: Add annotation support to perf c2c report")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/hist.h

index 6795816eee856e8f295fee721f43b8beee06d517..1d5ea632ca4e1b0b755f9c952fc17b923b3c46a6 100644 (file)
@@ -709,12 +709,12 @@ struct block_hist {
        struct hist_entry       he;
 };
 
+#define NO_ADDR 0
+
 #ifdef HAVE_SLANG_SUPPORT
 #include "../ui/keysyms.h"
 void attr_to_script(char *buf, struct perf_event_attr *attr);
 
-#define NO_ADDR 0
-
 int __hist_entry__tui_annotate(struct hist_entry *he, struct map_symbol *ms,
                               struct evsel *evsel,
                               struct hist_browser_timer *hbt, u64 al_addr);
@@ -748,14 +748,16 @@ int evlist__tui_browse_hists(struct evlist *evlist __maybe_unused,
 static inline int __hist_entry__tui_annotate(struct hist_entry *he __maybe_unused,
                                             struct map_symbol *ms __maybe_unused,
                                             struct evsel *evsel __maybe_unused,
-                                            struct hist_browser_timer *hbt __maybe_unused)
+                                            struct hist_browser_timer *hbt __maybe_unused,
+                                            u64 al_addr __maybe_unused)
 {
        return 0;
 }
 
 static inline int hist_entry__tui_annotate(struct hist_entry *he __maybe_unused,
                                           struct evsel *evsel __maybe_unused,
-                                          struct hist_browser_timer *hbt __maybe_unused)
+                                          struct hist_browser_timer *hbt __maybe_unused,
+                                          u64 al_addr __maybe_unused)
 {
        return 0;
 }