diff options
| -rw-r--r-- | tools/include/uapi/sound/asound.h | 1 | ||||
| -rw-r--r-- | tools/perf/builtin-top.c | 1 | ||||
| -rw-r--r-- | tools/perf/util/env.c | 8 | ||||
| -rw-r--r-- | tools/perf/util/evlist.c | 14 | ||||
| -rw-r--r-- | tools/perf/util/map.c | 20 | ||||
| -rw-r--r-- | tools/perf/util/map.h | 4 |
6 files changed, 37 insertions, 11 deletions
diff --git a/tools/include/uapi/sound/asound.h b/tools/include/uapi/sound/asound.h index 404d4b9ffe76..df1153cea0b7 100644 --- a/tools/include/uapi/sound/asound.h +++ b/tools/include/uapi/sound/asound.h | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | #ifndef __KERNEL__ | 33 | #ifndef __KERNEL__ |
| 34 | #include <stdlib.h> | 34 | #include <stdlib.h> |
| 35 | #include <time.h> | ||
| 35 | #endif | 36 | #endif |
| 36 | 37 | ||
| 37 | /* | 38 | /* |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 1999d6533d12..fbbb0da43abb 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
| @@ -1377,6 +1377,7 @@ int cmd_top(int argc, const char **argv) | |||
| 1377 | * */ | 1377 | * */ |
| 1378 | .overwrite = 0, | 1378 | .overwrite = 0, |
| 1379 | .sample_time = true, | 1379 | .sample_time = true, |
| 1380 | .sample_time_set = true, | ||
| 1380 | }, | 1381 | }, |
| 1381 | .max_stack = sysctl__max_stack(), | 1382 | .max_stack = sysctl__max_stack(), |
| 1382 | .annotation_opts = annotation__default_options, | 1383 | .annotation_opts = annotation__default_options, |
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c index c6351b557bb0..9494f9dc61ec 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c | |||
| @@ -57,9 +57,11 @@ struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env, | |||
| 57 | else if (prog_id > node->info_linear->info.id) | 57 | else if (prog_id > node->info_linear->info.id) |
| 58 | n = n->rb_right; | 58 | n = n->rb_right; |
| 59 | else | 59 | else |
| 60 | break; | 60 | goto out; |
| 61 | } | 61 | } |
| 62 | node = NULL; | ||
| 62 | 63 | ||
| 64 | out: | ||
| 63 | up_read(&env->bpf_progs.lock); | 65 | up_read(&env->bpf_progs.lock); |
| 64 | return node; | 66 | return node; |
| 65 | } | 67 | } |
| @@ -109,10 +111,12 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id) | |||
| 109 | else if (btf_id > node->id) | 111 | else if (btf_id > node->id) |
| 110 | n = n->rb_right; | 112 | n = n->rb_right; |
| 111 | else | 113 | else |
| 112 | break; | 114 | goto out; |
| 113 | } | 115 | } |
| 116 | node = NULL; | ||
| 114 | 117 | ||
| 115 | up_read(&env->bpf_progs.lock); | 118 | up_read(&env->bpf_progs.lock); |
| 119 | out: | ||
| 116 | return node; | 120 | return node; |
| 117 | } | 121 | } |
| 118 | 122 | ||
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 6689378ee577..51ead577533f 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
| @@ -1868,12 +1868,12 @@ static void *perf_evlist__poll_thread(void *arg) | |||
| 1868 | { | 1868 | { |
| 1869 | struct perf_evlist *evlist = arg; | 1869 | struct perf_evlist *evlist = arg; |
| 1870 | bool draining = false; | 1870 | bool draining = false; |
| 1871 | int i; | 1871 | int i, done = 0; |
| 1872 | |||
| 1873 | while (!done) { | ||
| 1874 | bool got_data = false; | ||
| 1872 | 1875 | ||
| 1873 | while (draining || !(evlist->thread.done)) { | 1876 | if (evlist->thread.done) |
| 1874 | if (draining) | ||
| 1875 | draining = false; | ||
| 1876 | else if (evlist->thread.done) | ||
| 1877 | draining = true; | 1877 | draining = true; |
| 1878 | 1878 | ||
| 1879 | if (!draining) | 1879 | if (!draining) |
| @@ -1894,9 +1894,13 @@ static void *perf_evlist__poll_thread(void *arg) | |||
| 1894 | pr_warning("cannot locate proper evsel for the side band event\n"); | 1894 | pr_warning("cannot locate proper evsel for the side band event\n"); |
| 1895 | 1895 | ||
| 1896 | perf_mmap__consume(map); | 1896 | perf_mmap__consume(map); |
| 1897 | got_data = true; | ||
| 1897 | } | 1898 | } |
| 1898 | perf_mmap__read_done(map); | 1899 | perf_mmap__read_done(map); |
| 1899 | } | 1900 | } |
| 1901 | |||
| 1902 | if (draining && !got_data) | ||
| 1903 | break; | ||
| 1900 | } | 1904 | } |
| 1901 | return NULL; | 1905 | return NULL; |
| 1902 | } | 1906 | } |
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index e32628cd20a7..ee71efb9db62 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
| @@ -261,6 +261,22 @@ bool __map__is_extra_kernel_map(const struct map *map) | |||
| 261 | return kmap && kmap->name[0]; | 261 | return kmap && kmap->name[0]; |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | bool __map__is_bpf_prog(const struct map *map) | ||
| 265 | { | ||
| 266 | const char *name; | ||
| 267 | |||
| 268 | if (map->dso->binary_type == DSO_BINARY_TYPE__BPF_PROG_INFO) | ||
| 269 | return true; | ||
| 270 | |||
| 271 | /* | ||
| 272 | * If PERF_RECORD_BPF_EVENT is not included, the dso will not have | ||
| 273 | * type of DSO_BINARY_TYPE__BPF_PROG_INFO. In such cases, we can | ||
| 274 | * guess the type based on name. | ||
| 275 | */ | ||
| 276 | name = map->dso->short_name; | ||
| 277 | return name && (strstr(name, "bpf_prog_") == name); | ||
| 278 | } | ||
| 279 | |||
| 264 | bool map__has_symbols(const struct map *map) | 280 | bool map__has_symbols(const struct map *map) |
| 265 | { | 281 | { |
| 266 | return dso__has_symbols(map->dso); | 282 | return dso__has_symbols(map->dso); |
| @@ -910,10 +926,8 @@ static void __maps__insert_name(struct maps *maps, struct map *map) | |||
| 910 | rc = strcmp(m->dso->short_name, map->dso->short_name); | 926 | rc = strcmp(m->dso->short_name, map->dso->short_name); |
| 911 | if (rc < 0) | 927 | if (rc < 0) |
| 912 | p = &(*p)->rb_left; | 928 | p = &(*p)->rb_left; |
| 913 | else if (rc > 0) | ||
| 914 | p = &(*p)->rb_right; | ||
| 915 | else | 929 | else |
| 916 | return; | 930 | p = &(*p)->rb_right; |
| 917 | } | 931 | } |
| 918 | rb_link_node(&map->rb_node_name, parent, p); | 932 | rb_link_node(&map->rb_node_name, parent, p); |
| 919 | rb_insert_color(&map->rb_node_name, &maps->names); | 933 | rb_insert_color(&map->rb_node_name, &maps->names); |
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 0e20749f2c55..dc93787c74f0 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h | |||
| @@ -159,10 +159,12 @@ int map__set_kallsyms_ref_reloc_sym(struct map *map, const char *symbol_name, | |||
| 159 | 159 | ||
| 160 | bool __map__is_kernel(const struct map *map); | 160 | bool __map__is_kernel(const struct map *map); |
| 161 | bool __map__is_extra_kernel_map(const struct map *map); | 161 | bool __map__is_extra_kernel_map(const struct map *map); |
| 162 | bool __map__is_bpf_prog(const struct map *map); | ||
| 162 | 163 | ||
| 163 | static inline bool __map__is_kmodule(const struct map *map) | 164 | static inline bool __map__is_kmodule(const struct map *map) |
| 164 | { | 165 | { |
| 165 | return !__map__is_kernel(map) && !__map__is_extra_kernel_map(map); | 166 | return !__map__is_kernel(map) && !__map__is_extra_kernel_map(map) && |
| 167 | !__map__is_bpf_prog(map); | ||
| 166 | } | 168 | } |
| 167 | 169 | ||
| 168 | bool map__has_symbols(const struct map *map); | 170 | bool map__has_symbols(const struct map *map); |
