/tools/include/asm-generic/bitops/ |
D | non-atomic.h | 16 static inline void __set_bit(int nr, volatile unsigned long *addr) in __set_bit() argument 18 unsigned long mask = BIT_MASK(nr); in __set_bit() 19 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __set_bit() 24 static inline void __clear_bit(int nr, volatile unsigned long *addr) in __clear_bit() argument 26 unsigned long mask = BIT_MASK(nr); in __clear_bit() 27 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __clear_bit() 41 static inline void __change_bit(int nr, volatile unsigned long *addr) in __change_bit() argument 43 unsigned long mask = BIT_MASK(nr); in __change_bit() 44 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in __change_bit() 58 static inline int __test_and_set_bit(int nr, volatile unsigned long *addr) in __test_and_set_bit() argument [all …]
|
D | atomic.h | 8 static inline void set_bit(int nr, unsigned long *addr) in set_bit() argument 10 addr[nr / __BITS_PER_LONG] |= 1UL << (nr % __BITS_PER_LONG); in set_bit() 13 static inline void clear_bit(int nr, unsigned long *addr) in clear_bit() argument 15 addr[nr / __BITS_PER_LONG] &= ~(1UL << (nr % __BITS_PER_LONG)); in clear_bit()
|
/tools/testing/selftests/gpio/ |
D | gpio-mockup-sysfs.sh | 7 active_low_sysfs=`cat $GPIO_SYSFS/gpio$nr/active_low` 8 val_sysfs=`cat $GPIO_SYSFS/gpio$nr/value` 9 dir_sysfs=`cat $GPIO_SYSFS/gpio$nr/direction` 11 gpio_this_debugfs=`cat $GPIO_DEBUGFS |grep "gpio-$nr" | sed "s/(.*)//g"` 38 nr=$1 43 echo $direction > $GPIO_SYSFS/gpio$nr/direction 44 echo $active_low > $GPIO_SYSFS/gpio$nr/active_low 46 echo $value > $GPIO_SYSFS/gpio$nr/value 48 is_consistent $nr 53 nr=$1 [all …]
|
/tools/perf/trace/beauty/ |
D | ioctl.c | 21 static size_t ioctl__scnprintf_tty_cmd(int nr, int dir, char *bf, size_t size) in ioctl__scnprintf_tty_cmd() argument 41 if (nr < strarray__ioctl_tty_cmd.nr_entries && strarray__ioctl_tty_cmd.entries[nr] != NULL) in ioctl__scnprintf_tty_cmd() 42 return scnprintf(bf, size, "%s", strarray__ioctl_tty_cmd.entries[nr]); in ioctl__scnprintf_tty_cmd() 44 return scnprintf(bf, size, "(%#x, %#x, %#x)", 'T', nr, dir); in ioctl__scnprintf_tty_cmd() 47 static size_t ioctl__scnprintf_drm_cmd(int nr, int dir, char *bf, size_t size) in ioctl__scnprintf_drm_cmd() argument 52 if (nr < strarray__drm_ioctl_cmds.nr_entries && strarray__drm_ioctl_cmds.entries[nr] != NULL) in ioctl__scnprintf_drm_cmd() 53 return scnprintf(bf, size, "DRM_%s", strarray__drm_ioctl_cmds.entries[nr]); in ioctl__scnprintf_drm_cmd() 55 return scnprintf(bf, size, "(%#x, %#x, %#x)", 'd', nr, dir); in ioctl__scnprintf_drm_cmd() 58 static size_t ioctl__scnprintf_sndrv_pcm_cmd(int nr, int dir, char *bf, size_t size) in ioctl__scnprintf_sndrv_pcm_cmd() argument 63 …if (nr < strarray__sndrv_pcm_ioctl_cmds.nr_entries && strarray__sndrv_pcm_ioctl_cmds.entries[nr] !… in ioctl__scnprintf_sndrv_pcm_cmd() [all …]
|
/tools/include/linux/ |
D | bits.h | 8 #define BIT(nr) (UL(1) << (nr)) argument 9 #define BIT_ULL(nr) (ULL(1) << (nr)) argument 10 #define BIT_MASK(nr) (UL(1) << ((nr) % BITS_PER_LONG)) argument 11 #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) argument 12 #define BIT_ULL_MASK(nr) (ULL(1) << ((nr) % BITS_PER_LONG_LONG)) argument 13 #define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) argument
|
D | bitops.h | 17 #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) argument 18 #define BITS_TO_U64(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u64)) argument 19 #define BITS_TO_U32(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(u32)) argument 20 #define BITS_TO_BYTES(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE) argument
|
D | bitmap.h | 88 static inline int test_and_set_bit(int nr, unsigned long *addr) in test_and_set_bit() argument 90 unsigned long mask = BIT_MASK(nr); in test_and_set_bit() 91 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in test_and_set_bit() 105 static inline int test_and_clear_bit(int nr, unsigned long *addr) in test_and_clear_bit() argument 107 unsigned long mask = BIT_MASK(nr); in test_and_clear_bit() 108 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); in test_and_clear_bit()
|
/tools/lib/api/fd/ |
D | array.c | 16 fda->nr = fda->nr_alloc = 0; in fdarray__init() 20 int fdarray__grow(struct fdarray *fda, int nr) in fdarray__grow() argument 23 int nr_alloc = fda->nr_alloc + nr; in fdarray__grow() 74 int pos = fda->nr; in fdarray__add() 76 if (fda->nr == fda->nr_alloc && in fdarray__add() 80 fda->entries[fda->nr].fd = fd; in fdarray__add() 81 fda->entries[fda->nr].events = revents; in fdarray__add() 82 fda->nr++; in fdarray__add() 90 int fd, nr = 0; in fdarray__filter() local 92 if (fda->nr == 0) in fdarray__filter() [all …]
|
/tools/perf/arch/x86/entry/syscalls/ |
D | syscalltbl.sh | 8 nr="$1" 11 echo " [$nr] = \"$name\"," 15 nr="$1" 18 syscall_macro "$nr" "$entry" 27 while read nr abi name entry compat; do 28 if [ $nr -ge 512 ] ; then # discard compat sycalls 32 emit "$nr" "$name" 33 max_nr=$nr
|
/tools/perf/arch/powerpc/entry/syscalls/ |
D | mksyscalltbl | 22 local max_nr nr abi sc discard 24 nr=0 27 while read nr abi sc discard; do 28 if [ "$max_nr" -lt "$nr" ]; then 29 printf '\t[%d] = "%s",\n' $nr $sc 30 max_nr=$nr
|
/tools/perf/lib/ |
D | threadmap.c | 10 static void perf_thread_map__reset(struct perf_thread_map *map, int start, int nr) in perf_thread_map__reset() argument 12 size_t size = (nr - start) * sizeof(map->map[0]); in perf_thread_map__reset() 18 struct perf_thread_map *perf_thread_map__realloc(struct perf_thread_map *map, int nr) in perf_thread_map__realloc() argument 20 size_t size = sizeof(*map) + sizeof(map->map[0]) * nr; in perf_thread_map__realloc() 21 int start = map ? map->nr : 0; in perf_thread_map__realloc() 28 perf_thread_map__reset(map, start, nr); in perf_thread_map__realloc() 51 threads->nr = 1; in perf_thread_map__new_dummy() 64 for (i = 0; i < threads->nr; i++) in perf_thread_map__delete() 85 return threads ? threads->nr : 1; in perf_thread_map__nr()
|
/tools/perf/util/ |
D | cpumap.c | 25 map = perf_cpu_map__empty_new(cpus->nr); in cpu_map__from_entries() 29 for (i = 0; i < cpus->nr; i++) { in cpu_map__from_entries() 48 int nr, nbits = mask->nr * mask->long_size * BITS_PER_BYTE; in cpu_map__from_mask() local 50 nr = bitmap_weight(mask->mask, nbits); in cpu_map__from_mask() 52 map = perf_cpu_map__empty_new(nr); in cpu_map__from_mask() 81 struct perf_cpu_map *perf_cpu_map__empty_new(int nr) in perf_cpu_map__empty_new() argument 83 struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int) * nr); in perf_cpu_map__empty_new() 88 cpus->nr = nr; in perf_cpu_map__empty_new() 89 for (i = 0; i < nr; i++) in perf_cpu_map__empty_new() 118 if (idx > map->nr) in cpu_map__get_socket() [all …]
|
D | thread_map.c | 50 threads->nr = items; in thread_map__new_by_pid() 67 threads->nr = 1; in thread_map__new_by_tid() 89 threads->nr = 0; in __thread_map__new_all_cpus() 114 while (threads->nr + items >= max_threads) { in __thread_map__new_all_cpus() 130 perf_thread_map__set_pid(threads, threads->nr + i, in __thread_map__new_all_cpus() 138 threads->nr += items; in __thread_map__new_all_cpus() 223 threads->nr = total_tasks; in thread_map__new_by_pid_str() 279 threads->nr = ntasks; in thread_map__new_by_tid_str() 311 threads->nr, threads->nr > 1 ? "s" : ""); in thread_map__fprintf() 312 for (i = 0; i < threads->nr; ++i) in thread_map__fprintf() [all …]
|
D | cputopo.c | 178 u32 nr, i, nr_addr; in cpu_topology__new() local 194 nr = (u32)(ncpus & UINT_MAX); in cpu_topology__new() 196 sz = nr * sizeof(char *); in cpu_topology__new() 215 for (i = 0; i < nr; i++) { in cpu_topology__new() 233 static int load_numa_node(struct numa_topology_node *node, int nr) in load_numa_node() argument 243 node->node = (u32) nr; in load_numa_node() 246 sysfs__mountpoint(), nr); in load_numa_node() 269 sysfs__mountpoint(), nr); in load_numa_node() 300 u32 nr, i; in numa_topology__new() local 322 nr = (u32) node_map->nr; in numa_topology__new() [all …]
|
D | data.c | 21 static void close_dir(struct perf_data_file *files, int nr) in close_dir() argument 23 while (--nr >= 0) { in close_dir() 24 close(files[nr].fd); in close_dir() 25 zfree(&files[nr].path); in close_dir() 32 close_dir(data->dir.files, data->dir.nr); in perf_data__close_dir() 35 int perf_data__create_dir(struct perf_data *data, int nr) in perf_data__create_dir() argument 43 files = zalloc(nr * sizeof(*files)); in perf_data__create_dir() 47 for (i = 0; i < nr; i++) { in perf_data__create_dir() 63 data->dir.nr = nr; in perf_data__create_dir() 77 int nr = 0; in perf_data__open_dir() local [all …]
|
D | strbuf.c | 49 size_t nr = sb->len + extra + 1; in strbuf_grow() local 51 if (nr < sb->alloc) in strbuf_grow() 54 if (nr <= sb->len) in strbuf_grow() 57 if (alloc_nr(sb->alloc) > nr) in strbuf_grow() 58 nr = alloc_nr(sb->alloc); in strbuf_grow() 64 buf = realloc(sb->alloc ? sb->buf : NULL, nr * sizeof(*buf)); in strbuf_grow() 69 sb->alloc = nr; in strbuf_grow()
|
/tools/perf/arch/s390/entry/syscalls/ |
D | mksyscalltbl | 19 local max_nr nr abi sc discard 22 while read nr abi sc discard; do 23 printf '\t[%d] = "%s",\n' $nr $sc 24 max_nr=$nr
|
/tools/testing/selftests/x86/ |
D | mov_ss_trap.c | 146 unsigned long nr; in main() local 159 asm volatile ("mov %[ss], %[tmp]" : [tmp] "=r" (nr) : [ss] "m" (ss)); in main() 180 nr = -1; in main() 182 : [tmp] "+r" (nr) : [ss] "m" (ss)); in main() 204 : [tmp] "=r" (nr) : [ss] "m" (ss)); in main() 226 nr = SYS_getpid; in main() 234 : "+a" (nr) : [ss] "m" (ss) in main() 259 nr = SYS_getpid; in main() 261 asm volatile ("xorl %%ebp, %%ebp; mov %[ss], %%ss; SYSENTER" : "+a" (nr) in main() 274 nr = 20; /* compat getpid */ in main() [all …]
|
D | syscall_numbering.c | 20 static void check_enosys(unsigned long nr, bool *ok) in check_enosys() argument 25 long ret = syscall(nr, 0, 0, 0, 0, 0, 0); in check_enosys() 27 printf("[FAIL]\tsyscall %lu succeeded, but it should have failed\n", nr); in check_enosys() 30 printf("[FAIL]\tsyscall %lu had error code %d, but it should have reported ENOSYS\n", nr, errno); in check_enosys()
|
/tools/perf/tests/ |
D | thread-map.c | 35 TEST_ASSERT_VAL("wrong nr", map->nr == 1); in test__thread_map() 51 TEST_ASSERT_VAL("wrong nr", map->nr == 1); in test__thread_map() 70 TEST_ASSERT_VAL("wrong nr", map->nr == 1); in process_event() 77 TEST_ASSERT_VAL("wrong nr", threads->nr == 1); in process_event() 128 TEST_ASSERT_VAL("thread_map count != 1", threads->nr == 1); in test__thread_map_remove() 136 TEST_ASSERT_VAL("thread_map count != 0", threads->nr == 0); in test__thread_map_remove() 144 for (i = 0; i < threads->nr; i++) in test__thread_map_remove()
|
D | dso-data.c | 182 long nr = 0; in open_files_cnt() local 195 nr++; in open_files_cnt() 199 return nr - 1; in open_files_cnt() 254 long nr_end, nr = open_files_cnt(); in test__dso_data_cache() local 263 limit = nr * 4; in test__dso_data_cache() 306 pr_debug("nr start %ld, nr stop %ld\n", nr, nr_end); in test__dso_data_cache() 307 TEST_ASSERT_VAL("failed leaking files", nr == nr_end); in test__dso_data_cache() 314 long nr_end, nr = open_files_cnt(); in test__dso_data_reopen() local 337 !set_fd_limit((nr + 3))); in test__dso_data_reopen() 382 pr_debug("nr start %ld, nr stop %ld\n", nr, nr_end); in test__dso_data_reopen() [all …]
|
D | openat-syscall-all-cpus.c | 61 for (cpu = 0; cpu < cpus->nr; ++cpu) { in test__openat_syscall_event_on_all_cpus() 93 if (perf_evsel__alloc_counts(evsel, cpus->nr, 1) < 0) { in test__openat_syscall_event_on_all_cpus() 94 pr_debug("perf_evsel__alloc_counts(ncpus=%d)\n", cpus->nr); in test__openat_syscall_event_on_all_cpus() 100 for (cpu = 0; cpu < cpus->nr; ++cpu) { in test__openat_syscall_event_on_all_cpus()
|
/tools/testing/selftests/vm/ |
D | userfaultfd.c | 716 unsigned long nr; in faulting_process() local 740 for (nr = 0; nr < split_nr_pages; nr++) { in faulting_process() 743 if (nr == lastnr) { in faulting_process() 748 lastnr = nr; in faulting_process() 750 if (copy_page(uffd, nr * page_size)) in faulting_process() 759 count = *area_count(area_dst, nr); in faulting_process() 760 if (count != count_verify[nr]) { in faulting_process() 763 nr, count, in faulting_process() 764 count_verify[nr]), exit(1); in faulting_process() 779 for (; nr < nr_pages; nr++) { in faulting_process() [all …]
|
/tools/lib/subcmd/ |
D | subcmd-util.h | 39 #define ALLOC_GROW(x, nr, alloc) \ argument 41 if ((nr) > alloc) { \ 42 if (alloc_nr(alloc) < (nr)) \ 43 alloc = (nr); \
|
/tools/perf/lib/include/internal/ |
D | threadmap.h | 16 int nr; member 21 struct perf_thread_map *perf_thread_map__realloc(struct perf_thread_map *map, int nr);
|