Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753660AbbBZQNg (ORCPT ); Thu, 26 Feb 2015 11:13:36 -0500 Received: from cantor2.suse.de ([195.135.220.15]:58793 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754572AbbBZQNZ (ORCPT ); Thu, 26 Feb 2015 11:13:25 -0500 From: Petr Mladek To: Masami Hiramatsu , "David S. Miller" , Anil S Keshavamurthy , Ananth N Mavinakayanahalli , Frederic Weisbecker Cc: Ingo Molnar , Steven Rostedt , Jiri Kosina , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH 7/7] kprobes: Mark globally disabled Kprobes in debugfs interface Date: Thu, 26 Feb 2015 17:13:52 +0100 Message-Id: <1424967232-2923-8-git-send-email-pmladek@suse.cz> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1424967232-2923-1-git-send-email-pmladek@suse.cz> References: <1424967232-2923-1-git-send-email-pmladek@suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2234 Lines: 56 Kprobes might get globally disabled by writing to /sys/kernel/debug/kprobes/enabled but this situation is not visible in /sys/kernel/debug/kprobes/list. This patch updates the list, so that it shows [GLOBALLY DISABLED] when the related Kprobe is enabled but globally disabled. It also updates the Kprobes documentation. Signed-off-by: Petr Mladek --- Documentation/kprobes.txt | 5 +++-- kernel/kprobes.c | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 4227ec2e3ab2..8de83af9cccb 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt @@ -701,8 +701,9 @@ is also specified. Following columns show probe status. If the probe is on a virtual address that is no longer valid (module init sections, module virtual addresses that correspond to modules that've been unloaded), such probes are marked with [GONE]. If the probe is temporarily disabled, -such probes are marked with [DISABLED]. If the probe is optimized, it is -marked with [OPTIMIZED]. +such probes are marked with [DISABLED]. It the probe is enabled but all probes +are globally disabled, such probes are marked with [GLOBALLY DISABLED]. +If the probe is optimized, it is marked with [OPTIMIZED]. /sys/kernel/debug/kprobes/enabled: Turn kprobes ON/OFF forcibly. diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 799f56a50cf9..7fc77c9cdd3b 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -2259,9 +2259,11 @@ static void report_probe(struct seq_file *pi, struct kprobe *p, if (!pp) pp = p; - seq_printf(pi, "%s%s%s%s\n", + seq_printf(pi, "%s%s%s%s%s\n", (kprobe_gone(p) ? "[GONE]" : ""), ((kprobe_disabled(p) && !kprobe_gone(p)) ? "[DISABLED]" : ""), + ((!kprobe_disabled(p) && !kprobe_gone(p) && + kprobes_all_disarmed) ? "[GLOBALLY DISABLED]" : ""), (kprobe_optimized(pp) ? "[OPTIMIZED]" : ""), (kprobe_ftrace(pp) ? "[FTRACE]" : "")); } -- 1.8.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/