#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; } cgit.cgi/linux/net-next.git/refs/?h=nds-private-remove&id=52f5631a4c056ad01682393be56d2be237e81610'>refslogtreecommitdiff
diff options
context:
space:
mode:
authorJurij Smakov <jurij@wooyd.org>2017-01-30 15:41:36 -0600
committerKalle Valo <kvalo@codeaurora.org>2017-01-31 09:05:25 +0200
commit52f5631a4c056ad01682393be56d2be237e81610 (patch)
tree53d1ddd2c1b179c808df10b6ce731ad26aa9f31b /sound/pci/oxygen/pcm1796.h
parent2b1d530cb3157f828fcaadd259613f59db3c6d1c (diff)
rtlwifi: rtl8192ce: Fix loading of incorrect firmware
In commit cf4747d7535a ("rtlwifi: Fix regression caused by commit d86e64768859, an error in the edit results in the wrong firmware being loaded for some models of the RTL8188/8192CE. In this condition, the connection suffered from high ping latency, slow transfer rates, and required higher signal strengths to work at all See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853073, https://bugzilla.opensuse.org/show_bug.cgi?id=1017471, and https://github.com/lwfinger/rtlwifi_new/issues/203 for descriptions of the problems. This patch fixes all of those problems. Fixes: cf4747d7535a ("rtlwifi: Fix regression caused by commit d86e64768859") Signed-off-by: Jurij Smakov <jurij@wooyd.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> # 4.9+ Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'sound/pci/oxygen/pcm1796.h')