#include "perf.h" #include "util/util.h" #include "util/debug.h" #include #include "util/parse-branch-options.h" #define BRANCH_OPT(n, m) \ { .name = n, .mode = (m) } #define BRANCH_END { .name = NULL } struct branch_mode { const char *name; int mode; }; static const struct branch_mode branch_modes[] = { BRANCH_OPT("u", PERF_SAMPLE_BRANCH_USER), BRANCH_OPT("k", PERF_SAMPLE_BRANCH_KERNEL), BRANCH_OPT("hv", PERF_SAMPLE_BRANCH_HV), BRANCH_OPT("any", PERF_SAMPLE_BRANCH_ANY), BRANCH_OPT("any_call", PERF_SAMPLE_BRANCH_ANY_CALL), BRANCH_OPT("any_ret", PERF_SAMPLE_BRANCH_ANY_RETURN), BRANCH_OPT("ind_call", PERF_SAMPLE_BRANCH_IND_CALL), BRANCH_OPT("abort_tx", PERF_SAMPLE_BRANCH_ABORT_TX), BRANCH_OPT("in_tx", PERF_SAMPLE_BRANCH_IN_TX), BRANCH_OPT("no_tx", PERF_SAMPLE_BRANCH_NO_TX), BRANCH_OPT("cond", PERF_SAMPLE_BRANCH_COND), BRANCH_OPT("ind_jmp", PERF_SAMPLE_BRANCH_IND_JUMP), BRANCH_OPT("call", PERF_SAMPLE_BRANCH_CALL), BRANCH_END }; int parse_branch_str(const char *str, __u64 *mode) { #define ONLY_PLM \ (PERF_SAMPLE_BRANCH_USER |\ PERF_SAMPLE_BRANCH_KERNEL |\ PERF_SAMPLE_BRANCH_HV) int ret = 0; char *p, *s; char *os = NULL; const struct branch_mode *br; if (str == NULL) { *mode = PERF_SAMPLE_BRANCH_ANY; return 0; } /* because str is read-only */ s = os = strdup(str); if (!s) return -1; for (;;) { p = strchr(s, ','); if (p) *p = '\0'; for (br = branch_modes; br->name; br++) { if (!strcasecmp(s, br->name)) break; } if (!br->name) { ret = -1; pr_warning("unknown branch filter %s," " check man page\n", s); goto error; } *mode |= br->mode; if (!p) break; s = p + 1; } /* default to any branch */ if ((*mode & ~ONLY_PLM) == 0) { *mode = PERF_SAMPLE_BRANCH_ANY; } error: free(os); return ret; } int parse_branch_stack(const struct option *opt, const char *str, int unset) { __u64 *mode = (__u64 *)opt->value; if (unset) return 0; /* * cannot set it twice, -b + --branch-filter for instance */ if (*mode) return -1; return parse_branch_str(str, mode); } /linux/net-next.git/diff/net/sched/Kconfig?h=nds-private-remove&id=aaaec6fc755447a1d056765b11b24d8ff2b81366'>diff
path: root/net/sched/Kconfig
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-01-31 19:03:21 +0100
committerThomas Gleixner <tglx@linutronix.de>2017-01-31 20:22:18 +0100
commitaaaec6fc755447a1d056765b11b24d8ff2b81366 (patch)
treea7f4167960ee1df86739905b6ccdeb95465bfe5f /net/sched/Kconfig
parent08d85f3ea99f1eeafc4e8507936190e86a16ee8c (diff)
x86/irq: Make irq activate operations symmetric
The recent commit which prevents double activation of interrupts unearthed interesting code in x86. The code (ab)uses irq_domain_activate_irq() to reconfigure an already activated interrupt. That trips over the prevention code now. Fix it by deactivating the interrupt before activating the new configuration. Fixes: 08d85f3ea99f1 "irqdomain: Avoid activating interrupts more than once" Reported-and-tested-by: Mike Galbraith <efault@gmx.de> Reported-and-tested-by: Borislav Petkov <bp@alien8.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1701311901580.3457@nanos
Diffstat (limited to 'net/sched/Kconfig')