Home
last modified time | relevance | path

Searched refs:st (Results 1 – 25 of 81) sorted by relevance

1234

/tools/perf/util/
Dbranch.c18 void branch_type_count(struct branch_type_stat *st, struct branch_flags *flags, in branch_type_count() argument
24 st->counts[flags->type]++; in branch_type_count()
28 st->cond_fwd++; in branch_type_count()
30 st->cond_bwd++; in branch_type_count()
34 st->cross_2m++; in branch_type_count()
36 st->cross_4k++; in branch_type_count()
61 void branch_type_stat_display(FILE *fp, struct branch_type_stat *st) in branch_type_stat_display() argument
67 total += st->counts[i]; in branch_type_stat_display()
76 if (st->cond_fwd > 0) { in branch_type_stat_display()
79 100.0 * (double)st->cond_fwd / (double)total); in branch_type_stat_display()
[all …]
Dstat-shadow.c103 struct runtime_stat *st) in saved_value_lookup() argument
112 .stat = st, in saved_value_lookup()
115 rblist = &st->value_list; in saved_value_lookup()
129 void runtime_stat__init(struct runtime_stat *st) in runtime_stat__init() argument
131 struct rblist *rblist = &st->value_list; in runtime_stat__init()
139 void runtime_stat__exit(struct runtime_stat *st) in runtime_stat__exit() argument
141 rblist__exit(&st->value_list); in runtime_stat__exit()
167 static void reset_stat(struct runtime_stat *st) in reset_stat() argument
172 rblist = &st->value_list; in reset_stat()
189 void perf_stat__reset_shadow_per_stat(struct runtime_stat *st) in perf_stat__reset_shadow_per_stat() argument
[all …]
Ddata.c100 struct stat st; in perf_data__open_dir() local
103 if (stat(path, &st)) in perf_data__open_dir()
106 if (!S_ISREG(st.st_mode) || strncmp(dent->d_name, "data.", 5)) in perf_data__open_dir()
127 file->size = st.st_size; in perf_data__open_dir()
153 struct stat st; in perf_data__update_dir() local
155 if (fstat(file->fd, &st)) in perf_data__update_dir()
158 file->size = st.st_size; in perf_data__update_dir()
166 struct stat st; in check_pipe() local
172 if (!fstat(fd, &st) && S_ISFIFO(st.st_mode)) in check_pipe()
187 struct stat st; in check_backup() local
[all …]
Dpath.c75 struct stat st; in is_regular_file() local
77 if (stat(file, &st)) in is_regular_file()
80 return S_ISREG(st.st_mode); in is_regular_file()
87 struct stat st; in is_directory() local
90 if (stat(path, &st)) in is_directory()
93 return S_ISDIR(st.st_mode); in is_directory()
Dbranch.h81 void branch_type_count(struct branch_type_stat *st, struct branch_flags *flags,
85 void branch_type_stat_display(FILE *fp, struct branch_type_stat *st);
86 int branch_type_str(struct branch_type_stat *st, char *bf, int bfsize);
Dtrace-event-info.c91 struct stat st; in record_header_files() local
99 if (stat(path, &st) < 0) { in record_header_files()
123 if (stat(path, &st) < 0) { in record_header_files()
164 struct stat st; in copy_event_system() local
185 ret = stat(format, &st); in copy_event_system()
207 ret = stat(format, &st); in copy_event_system()
256 struct stat st; in record_event_files() local
301 ret = stat(sys, &st); in record_event_files()
338 struct stat st; in record_ftrace_printk() local
347 ret = stat(path, &st); in record_ftrace_printk()
[all …]
Dstat.c454 struct perf_record_stat *st = &event->stat; in perf_event__process_stat_event() local
457 count.val = st->val; in perf_event__process_stat_event()
458 count.ena = st->ena; in perf_event__process_stat_event()
459 count.run = st->run; in perf_event__process_stat_event()
461 counter = perf_evlist__id2evsel(session->evlist, st->id); in perf_event__process_stat_event()
467 *perf_counts(counter->counts, st->cpu, st->thread) = count; in perf_event__process_stat_event()
474 struct perf_record_stat *st = (struct perf_record_stat *)event; in perf_event__fprintf_stat() local
478 st->id, st->cpu, st->thread); in perf_event__fprintf_stat()
480 st->val, st->ena, st->run); in perf_event__fprintf_stat()
Dstat.h193 void runtime_stat__init(struct runtime_stat *st);
194 void runtime_stat__exit(struct runtime_stat *st);
197 void perf_stat__reset_shadow_per_stat(struct runtime_stat *st);
199 int cpu, struct runtime_stat *st);
212 struct runtime_stat *st);
248 double test_generic_metric(struct metric_expr *mexp, int cpu, struct runtime_stat *st);
/tools/testing/selftests/kvm/
Dsteal_time.c33 static void check_status(struct kvm_steal_time *st) in check_status() argument
35 GUEST_ASSERT(!(READ_ONCE(st->version) & 1)); in check_status()
36 GUEST_ASSERT(READ_ONCE(st->flags) == 0); in check_status()
37 GUEST_ASSERT(READ_ONCE(st->preempted) == 0); in check_status()
42 struct kvm_steal_time *st = st_gva[cpu]; in guest_code() local
47 memset(st, 0, sizeof(*st)); in guest_code()
50 check_status(st); in guest_code()
51 WRITE_ONCE(guest_stolen_time[cpu], st->steal); in guest_code()
52 version = READ_ONCE(st->version); in guest_code()
53 check_status(st); in guest_code()
[all …]
/tools/testing/vsock/
Dvsock_diag_test.c92 static void print_vsock_stat(FILE *fp, struct vsock_stat *st) in print_vsock_stat() argument
94 print_vsock_addr(fp, st->msg.vdiag_src_cid, st->msg.vdiag_src_port); in print_vsock_stat()
96 print_vsock_addr(fp, st->msg.vdiag_dst_cid, st->msg.vdiag_dst_port); in print_vsock_stat()
98 sock_type_str(st->msg.vdiag_type), in print_vsock_stat()
99 sock_state_str(st->msg.vdiag_state), in print_vsock_stat()
100 sock_shutdown_str(st->msg.vdiag_shutdown), in print_vsock_stat()
101 st->msg.vdiag_ino); in print_vsock_stat()
106 struct vsock_stat *st; in print_vsock_stats() local
108 list_for_each_entry(st, head, list) in print_vsock_stats()
109 print_vsock_stat(fp, st); in print_vsock_stats()
[all …]
/tools/testing/scatterlist/
Dmain.c29 static void fail(struct test *test, struct sg_table *st, const char *cond) in fail() argument
36 test->size, test->max_seg, test->expected_segments, st->nents, in fail()
37 st->orig_nents); in fail()
47 #define VALIDATE(cond, st, test) \ argument
49 fail((test), (st), #cond);
81 struct sg_table st; in main() local
86 sg = __sg_alloc_table_from_pages(&st, pages, test->num_pages, 0, in main()
93 VALIDATE(st.nents == test->expected_segments, &st, test); in main()
94 VALIDATE(st.orig_nents == test->expected_segments, &st, test); in main()
96 sg_free_table(&st); in main()
/tools/testing/selftests/memfd/
Dfuse_mnt.c27 static int memfd_getattr(const char *path, struct stat *st) in memfd_getattr() argument
29 memset(st, 0, sizeof(*st)); in memfd_getattr()
32 st->st_mode = S_IFDIR | 0755; in memfd_getattr()
33 st->st_nlink = 2; in memfd_getattr()
35 st->st_mode = S_IFREG | 0444; in memfd_getattr()
36 st->st_nlink = 1; in memfd_getattr()
37 st->st_size = strlen(memfd_content); in memfd_getattr()
/tools/perf/
Dbuiltin-lock.c126 struct thread_stat *st; in thread_stat_find() local
130 st = container_of(node, struct thread_stat, rb); in thread_stat_find()
131 if (st->tid == tid) in thread_stat_find()
132 return st; in thread_stat_find()
133 else if (tid < st->tid) in thread_stat_find()
166 struct thread_stat *st; in thread_stat_findnew_after_first() local
168 st = thread_stat_find(tid); in thread_stat_findnew_after_first()
169 if (st) in thread_stat_findnew_after_first()
170 return st; in thread_stat_findnew_after_first()
172 st = zalloc(sizeof(struct thread_stat)); in thread_stat_findnew_after_first()
[all …]
/tools/perf/tests/
Dstat.c69 struct perf_record_stat *st = &event->stat; in process_stat_event() local
71 TEST_ASSERT_VAL("wrong cpu", st->cpu == 1); in process_stat_event()
72 TEST_ASSERT_VAL("wrong thread", st->thread == 2); in process_stat_event()
73 TEST_ASSERT_VAL("wrong id", st->id == 3); in process_stat_event()
74 TEST_ASSERT_VAL("wrong val", st->val == 100); in process_stat_event()
75 TEST_ASSERT_VAL("wrong run", st->ena == 200); in process_stat_event()
76 TEST_ASSERT_VAL("wrong ena", st->run == 300); in process_stat_event()
Dparse-metric.c101 static void load_runtime_stat(struct runtime_stat *st, struct evlist *evlist, in load_runtime_stat() argument
109 perf_stat__update_shadow_stats(evsel, count, 0, st); in load_runtime_stat()
114 struct runtime_stat *st, const char *name) in compute_single() argument
126 return test_generic_metric(mexp, 0, st); in compute_single()
141 struct runtime_stat st; in __compute_metric() local
160 runtime_stat__init(&st); in __compute_metric()
174 load_runtime_stat(&st, evlist, vals); in __compute_metric()
178 *ratio1 = compute_single(&metric_events, evlist, &st, name1); in __compute_metric()
180 *ratio2 = compute_single(&metric_events, evlist, &st, name2); in __compute_metric()
185 runtime_stat__exit(&st); in __compute_metric()
Dpe-file-parsing.c74 struct stat st; in test__pe_file_parsing() local
78 if (!lstat("./tests", &st)) in test__pe_file_parsing()
84 if (!lstat(path_dir, &st)) in test__pe_file_parsing()
Dbuiltin-test.c514 struct stat st; in shell_tests__dir() local
515 if (!lstat(devel_dirs[i], &st)) { in shell_tests__dir()
517 if (!lstat(devel_dirs[i], &st)) in shell_tests__dir()
569 struct shell_test *st = test->priv; in shell_test__run() local
571 path__join(script, sizeof(script), st->dir, st->file); in shell_test__run()
585 struct shell_test st = { in run_shell_tests() local
589 if (st.dir == NULL) in run_shell_tests()
592 dir = opendir(st.dir); in run_shell_tests()
595 st.dir); in run_shell_tests()
599 for_each_shell_test(dir, st.dir, ent) { in run_shell_tests()
[all …]
/tools/build/
Dfixdep.c123 struct stat st; in print_deps() local
133 if (fstat(fd, &st) < 0) { in print_deps()
138 if (st.st_size == 0) { in print_deps()
143 map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in print_deps()
150 parse_dep_file(map, st.st_size); in print_deps()
152 munmap(map, st.st_size); in print_deps()
/tools/testing/selftests/proc/
Dfd-001-lookup.c35 struct stat st; in test_lookup_pass() local
38 memset(&st, 0, sizeof(struct stat)); in test_lookup_pass()
39 rv = lstat(pathname, &st); in test_lookup_pass()
41 assert(S_ISLNK(st.st_mode)); in test_lookup_pass()
46 struct stat st; in test_lookup_fail() local
49 rv = lstat(pathname, &st); in test_lookup_fail()
/tools/testing/selftests/bpf/
Dtest_current_pid_tgid_new_ns.c35 struct stat st; in main() local
39 if (stat("/proc/self/ns/pid", &st)) { in main()
93 struct stat st; in main() local
120 if (CHECK_NEWNS(stat("/proc/self/ns/pid", &st), in main()
124 bss.dev = st.st_dev; in main()
125 bss.ino = st.st_ino; in main()
/tools/testing/selftests/bpf/prog_tests/
Dns_current_pid_tgid.c26 struct stat st; in test_ns_current_pid_tgid() local
53 if (CHECK_FAIL(stat("/proc/self/ns/pid", &st))) { in test_ns_current_pid_tgid()
58 bss.dev = st.st_dev; in test_ns_current_pid_tgid()
59 bss.ino = st.st_ino; in test_ns_current_pid_tgid()
Dksyms.c16 struct stat st; in test_ksyms() local
32 if (CHECK(stat(btf_path, &st), "stat_btf", "err %d\n", errno)) in test_ksyms()
34 btf_size = st.st_size; in test_ksyms()
/tools/perf/pmu-events/
Djson.c47 struct stat st; in mapfile() local
59 err = fstat(fd, &st); in mapfile()
62 *size = st.st_size; in mapfile()
64 (st.st_size + ps - 1) & ~(ps - 1), in mapfile()
/tools/vm/
Dpage-types.c935 static void show_file(const char *name, const struct stat *st) in show_file() argument
937 unsigned long long size = st->st_size; in show_file()
942 name, (unsigned)st->st_ino, in show_file()
945 strftime(atime, sizeof(atime), "%c", localtime(&st->st_atime)); in show_file()
946 strftime(mtime, sizeof(mtime), "%c", localtime(&st->st_mtime)); in show_file()
949 mtime, now - st->st_mtime, in show_file()
950 atime, now - st->st_atime); in show_file()
970 static void walk_file(const char *name, const struct stat *st) in walk_file() argument
977 off_t off, end = st->st_size; in walk_file()
1040 show_file(name, st); in walk_file()
[all …]
/tools/io_uring/
Dio_uring-cp.c49 struct stat st; in get_file_size() local
51 if (fstat(fd, &st) < 0) in get_file_size()
53 if (S_ISREG(st.st_mode)) { in get_file_size()
54 *size = st.st_size; in get_file_size()
56 } else if (S_ISBLK(st.st_mode)) { in get_file_size()

1234