• Leo Yan's avatar
    perf test: Introduce script for data symbol testing · 60abedb8
    Leo Yan authored
    The test is designed with a data structure with 64-byte alignment, it
    has two fields "data1" and "data2", and other fields are reserved.
    
    Using the "perf mem" command, we can record and report memory samples
    for a self-contained workload with 1 second duration.  If no samples are
    obtained for the data structure "buf1", it reports failure;  and by
    checking the offset in structure "buf1", if the memory samples aren't
    for the "data1" and "data2" fields, it means wrong data symbol parsing
    and returns failure.
    
    Committer testing:
    
      [root@quaco ~]# grep -m1 "model name" /proc/cpuinfo
      model name	: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
      [root@quaco ~]#
      [root@quaco ~]# perf test -v "data symbol"
      104: Test data symbol                                                :
      --- start ---
      test child forked, pid 192318
      Compiling test program...
      Recording workload...
      [ perf record: Woken up 2 times to write data ]
      [ perf record: Captured and wrote 0.389 MB /tmp/__perf_test.perf.data.LIuQl (5570 samples) ]
      Cleaning up files...
      test child finished with 0
      ---- end ----
      Test data symbol: Ok
      [root@quaco ~]#
    Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.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>
    Cc: Ravi Bangoria <ravi.bangoria@amd.com>
    Link: https://lore.kernel.org/r/20221006101039.47870-1-leo.yan@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    60abedb8
test_data_symbol.sh 1.93 KB