~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/tests/hists_common.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __PERF_TESTS__HISTS_COMMON_H__
  3 #define __PERF_TESTS__HISTS_COMMON_H__
  4 
  5 struct machine;
  6 struct machines;
  7 
  8 #define FAKE_PID_PERF1  100
  9 #define FAKE_PID_PERF2  200
 10 #define FAKE_PID_BASH   300
 11 
 12 #define FAKE_MAP_PERF    0x400000
 13 #define FAKE_MAP_BASH    0x400000
 14 #define FAKE_MAP_LIBC    0x500000
 15 #define FAKE_MAP_KERNEL  0xf00000
 16 #define FAKE_MAP_LENGTH  0x100000
 17 
 18 #define FAKE_SYM_OFFSET1  700
 19 #define FAKE_SYM_OFFSET2  800
 20 #define FAKE_SYM_OFFSET3  900
 21 #define FAKE_SYM_LENGTH   100
 22 
 23 #define FAKE_IP_PERF_MAIN  FAKE_MAP_PERF + FAKE_SYM_OFFSET1
 24 #define FAKE_IP_PERF_RUN_COMMAND  FAKE_MAP_PERF + FAKE_SYM_OFFSET2
 25 #define FAKE_IP_PERF_CMD_RECORD  FAKE_MAP_PERF + FAKE_SYM_OFFSET3
 26 #define FAKE_IP_BASH_MAIN  FAKE_MAP_BASH + FAKE_SYM_OFFSET1
 27 #define FAKE_IP_BASH_XMALLOC  FAKE_MAP_BASH + FAKE_SYM_OFFSET2
 28 #define FAKE_IP_BASH_XFREE  FAKE_MAP_BASH + FAKE_SYM_OFFSET3
 29 #define FAKE_IP_LIBC_MALLOC  FAKE_MAP_LIBC + FAKE_SYM_OFFSET1
 30 #define FAKE_IP_LIBC_FREE  FAKE_MAP_LIBC + FAKE_SYM_OFFSET2
 31 #define FAKE_IP_LIBC_REALLOC  FAKE_MAP_LIBC + FAKE_SYM_OFFSET3
 32 #define FAKE_IP_KERNEL_SCHEDULE  FAKE_MAP_KERNEL + FAKE_SYM_OFFSET1
 33 #define FAKE_IP_KERNEL_PAGE_FAULT  FAKE_MAP_KERNEL + FAKE_SYM_OFFSET2
 34 #define FAKE_IP_KERNEL_SYS_PERF_EVENT_OPEN  FAKE_MAP_KERNEL + FAKE_SYM_OFFSET3
 35 
 36 /*
 37  * The setup_fake_machine() provides a test environment which consists
 38  * of 3 processes that have 3 mappings and in turn, have 3 symbols
 39  * respectively.  See below table:
 40  *
 41  * Command:  Pid  Shared Object               Symbol
 42  * .............  .............  ...................
 43  *    perf:  100           perf  main
 44  *    perf:  100           perf  run_command
 45  *    perf:  100           perf  cmd_record
 46  *    perf:  100           libc  malloc
 47  *    perf:  100           libc  free
 48  *    perf:  100           libc  realloc
 49  *    perf:  100       [kernel]  schedule
 50  *    perf:  100       [kernel]  page_fault
 51  *    perf:  100       [kernel]  sys_perf_event_open
 52  *    perf:  200           perf  main
 53  *    perf:  200           perf  run_command
 54  *    perf:  200           perf  cmd_record
 55  *    perf:  200           libc  malloc
 56  *    perf:  200           libc  free
 57  *    perf:  200           libc  realloc
 58  *    perf:  200       [kernel]  schedule
 59  *    perf:  200       [kernel]  page_fault
 60  *    perf:  200       [kernel]  sys_perf_event_open
 61  *    bash:  300           bash  main
 62  *    bash:  300           bash  xmalloc
 63  *    bash:  300           bash  xfree
 64  *    bash:  300           libc  malloc
 65  *    bash:  300           libc  free
 66  *    bash:  300           libc  realloc
 67  *    bash:  300       [kernel]  schedule
 68  *    bash:  300       [kernel]  page_fault
 69  *    bash:  300       [kernel]  sys_perf_event_open
 70  */
 71 struct machine *setup_fake_machine(struct machines *machines);
 72 
 73 void print_hists_in(struct hists *hists);
 74 void print_hists_out(struct hists *hists);
 75 
 76 #endif /* __PERF_TESTS__HISTS_COMMON_H__ */
 77 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php