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

TOMOYO Linux Cross Reference
Linux/tools/lib/perf/include/internal/cpumap.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __LIBPERF_INTERNAL_CPUMAP_H
  3 #define __LIBPERF_INTERNAL_CPUMAP_H
  4 
  5 #include <linux/refcount.h>
  6 #include <perf/cpumap.h>
  7 #include <internal/rc_check.h>
  8 
  9 /**
 10  * A sized, reference counted, sorted array of integers representing CPU
 11  * numbers. This is commonly used to capture which CPUs a PMU is associated
 12  * with. The indices into the cpumap are frequently used as they avoid having
 13  * gaps if CPU numbers were used. For events associated with a pid, rather than
 14  * a CPU, a single dummy map with an entry of -1 is used.
 15  */
 16 DECLARE_RC_STRUCT(perf_cpu_map) {
 17         refcount_t      refcnt;
 18         /** Length of the map array. */
 19         int             nr;
 20         /** The CPU values. */
 21         struct perf_cpu map[];
 22 };
 23 
 24 #ifndef MAX_NR_CPUS
 25 #define MAX_NR_CPUS     2048
 26 #endif
 27 
 28 struct perf_cpu_map *perf_cpu_map__alloc(int nr_cpus);
 29 int perf_cpu_map__idx(const struct perf_cpu_map *cpus, struct perf_cpu cpu);
 30 bool perf_cpu_map__is_subset(const struct perf_cpu_map *a, const struct perf_cpu_map *b);
 31 
 32 void perf_cpu_map__set_nr(struct perf_cpu_map *map, int nr_cpus);
 33 
 34 static inline refcount_t *perf_cpu_map__refcnt(struct perf_cpu_map *map)
 35 {
 36         return &RC_CHK_ACCESS(map)->refcnt;
 37 }
 38 #endif /* __LIBPERF_INTERNAL_CPUMAP_H */
 39 

~ [ 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