• Yang Jihong's avatar
    perf build: Add LIBTRACEEVENT_DIR build option · baa2ca59
    Yang Jihong authored
    Currently, when libtraceevent is not linked,
    perf does not support tracepoint:
    
      # ./perf record -e sched:sched_switch -a sleep 10
      event syntax error: 'sched:sched_switch'
                           \___ unsupported tracepoint
    
      libtraceevent is necessary for tracepoint support
      Run 'perf list' for a list of valid events
    
       Usage: perf record [<options>] [<command>]
          or: perf record [<options>] -- <command> [<options>]
    
          -e, --event <event>   event selector. use 'perf list' to list available events
    
    For cross-compilation scenario, library may not be installed in the default
    system path. Based on the above requirements, add LIBTRACEEVENT_DIR build
    option to support specifying path of libtraceevent.
    
    Example:
    
      1. Cross compile libtraceevent
      # cd /opt/libtraceevent
      # CROSS_COMPILE=aarch64-linux-gnu- make
    
      2. Cross compile perf
      # cd tool/perf
      # make VF=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- NO_LIBELF=1 LDFLAGS=--static LIBTRACEEVENT_DIR=/opt/libtraceevent
      <SNIP>
      Auto-detecting system features:
      <SNIP>
      ...                       LIBTRACEEVENT_DIR: /opt/libtraceevent
    Reviewed-by: default avatarIan Rogers <irogers@google.com>
    Signed-off-by: default avatarYang Jihong <yangjihong@bytedance.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/20240314063000.2139877-1-yangjihong@bytedance.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    baa2ca59
Makefile.config 42 KB