• Namhyung Kim's avatar
    perf annotate-data: Check memory access with two registers · eba1f853
    Namhyung Kim authored
    The following instruction pattern is used to access a global variable.
    
      mov     $0x231c0, %rax
      movsql  %edi, %rcx
      mov     -0x7dc94ae0(,%rcx,8), %rcx
      cmpl    $0x0, 0xa60(%rcx,%rax,1)     <<<--- here
    
    The first instruction set the address of the per-cpu variable (here, it
    is 'runqueues' of type 'struct rq').  The second instruction seems like
    a cpu number of the per-cpu base.  The third instruction get the base
    offset of per-cpu area for that cpu.  The last instruction compares the
    value of the per-cpu variable at the offset of 0xa60.
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20240502060011.1838090-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    eba1f853
annotate-data.c 50.8 KB