#include #include #include #include #include #include #include #include #include "libbpf.h" #include "bpf_util.h" #define MAX_INDEX 64 #define MAX_STARS 38 char bpf_log_buf[BPF_LOG_BUF_SIZE]; static void stars(char *str, long val, long max, int width) { int i; for (i = 0; i < (width * val / max) - 1 && i < width - 1; i++) str[i] = '*'; if (val > max) str[i - 1] = '+'; str[i] = '\0'; } int main(int argc, char **argv) { unsigned int nr_cpus = bpf_num_possible_cpus(); const char *map_filename = "/sys/fs/bpf/tc/globals/lwt_len_hist_map"; uint64_t values[nr_cpus], sum, max_value = 0, data[MAX_INDEX] = {}; uint64_t key = 0, next_key, max_key = 0; char starstr[MAX_STARS]; int i, map_fd; map_fd = bpf_obj_get(map_filename); if (map_fd < 0) { fprintf(stderr, "bpf_obj_get(%s): %s(%d)\n", map_filename, strerror(errno), errno); return -1; } while (bpf_map_get_next_key(map_fd, &key, &next_key) == 0) { if (next_key >= MAX_INDEX) { fprintf(stderr, "Key %lu out of bounds\n", next_key); continue; } bpf_map_lookup_elem(map_fd, &next_key, values); sum = 0; for (i = 0; i < nr_cpus; i++) sum += values[i]; data[next_key] = sum; if (sum && next_key > max_key) max_key = next_key; if (sum > max_value) max_value = sum; key = next_key; } for (i = 1; i <= max_key + 1; i++) { stars(starstr, data[i - 1], max_value, MAX_STARS); printf("%8ld -> %-8ld : %-8ld |%-*s|\n", (1l << i) >> 1, (1l << i) - 1, data[i - 1], MAX_STARS, starstr); } close(map_fd); return 0; } it/refs/?h=nds-private-remove&id=e6e7b48b295afa5a5ab440de0a94d9ad8b3ce2d0'>refslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-12 17:15:56 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-30 10:17:32 +0100
commite6e7b48b295afa5a5ab440de0a94d9ad8b3ce2d0 (patch)
tree77cadb6d8aad1b52c34e4afa8c9deef603bbe2ed /sound/soc/adi/Kconfig
parent4e5b54f127426c82dc2816340c26d951a5bb3429 (diff)
drm: Don't race connector registration
I was under the misconception that the sysfs dev stuff can be fully set up, and then registered all in one step with device_add. That's true for properties and property groups, but not for parents and child devices. Those must be fully registered before you can register a child. Add a bit of tracking to make sure that asynchronous mst connector hotplugging gets this right. For consistency we rely upon the implicit barriers of the connector->mutex, which is taken anyway, to ensure that at least either the connector or device registration call will work out. Mildly tested since I can't reliably reproduce this on my mst box here. Reported-by: Dave Hansen <dave.hansen@intel.com> Cc: Dave Hansen <dave.hansen@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1484237756-2720-1-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'sound/soc/adi/Kconfig')