From patchwork Wed Jul 18 18:56:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 10130 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 95B8223E2F for ; Wed, 18 Jul 2012 18:58:14 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 5D736A18019 for ; Wed, 18 Jul 2012 18:58:14 +0000 (UTC) Received: by yhpp61 with SMTP id p61so2097734yhp.11 for ; Wed, 18 Jul 2012 11:58:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=Xnq4rOHnBB5C9XnsSwxAPUtGwjNizFMyycheNUZ0FP8=; b=SMbilAel+qfbi6n6lsQg30duIlZimCK/Za9BQOYSx+dhzCigj34zQchqINApVhMifv uoJ9umBw7NJZNH5omTnYvpuDkA6R8PS4lxChKkfyaxtQGL5gZAnoIIvcRkp/JPLxgurc GPigVsgVQAJfi8PQOBb3sb0D7Yf3B7CeYbHquwU2GoyEp84ZlQJbjcmoBkdKbaYsX6dG LYy6LCkGNxcdxpcfQ4BB4sKgqhKplVRNasNGxA/2u/BugoZ1uS45WwpGrHURoZPeMHsf W+kQe0c2qrCC1abqZ0+W2ndfFXqXPUTQRDdakkaNosBZd4yzrcp5R2TXK3+waE6ZJmkb ekWg== Received: by 10.50.46.232 with SMTP id y8mr3068364igm.57.1342637893663; Wed, 18 Jul 2012 11:58:13 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.153.7 with SMTP id i7csp2810ibw; Wed, 18 Jul 2012 11:58:13 -0700 (PDT) Received: by 10.66.73.39 with SMTP id i7mr1953785pav.83.1342637892922; Wed, 18 Jul 2012 11:58:12 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id ot3si220031pbc.341.2012.07.18.11.58.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jul 2012 11:58:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by pbbrr4 with SMTP id rr4so3554763pbb.37 for ; Wed, 18 Jul 2012 11:58:12 -0700 (PDT) Received: by 10.68.202.133 with SMTP id ki5mr9979397pbc.10.1342637892558; Wed, 18 Jul 2012 11:58:12 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id ti1sm99113pbc.74.2012.07.18.11.58.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jul 2012 11:58:11 -0700 (PDT) From: Anton Vorontsov To: Steven Rostedt Cc: Ingo Molnar , John Stultz , linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, patches@linaro.org Subject: [PATCH] tracing: Remove unneeded checks from the stack tracer Date: Wed, 18 Jul 2012 11:56:01 -0700 Message-Id: <1342637761-9655-1-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQkQOq1uxV4hTYfccEqKDCcvleD5iCsEYDKmWpl12Jv8p/viQLk5VVVnhYlDPjGfJHXxT6Gm It seems that 'ftrace_enabled' flag should not be used inside the tracer functions. The ftrace core is using this flag for internal purposes, and the flag wasn't meant to be used in tracers' runtime checks. stack tracer is the only tracer that abusing the flag. So stop it from serving as a bad example. Also, there is a local 'stack_trace_disabled' flag in the stack tracer, which is never updated; so it can be removed as well. Signed-off-by: Anton Vorontsov --- kernel/trace/trace_stack.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index d4545f4..94c2c53 100644 --- a/kernel/trace/trace_stack.c +++ b/kernel/trace/trace_stack.c @@ -33,7 +33,6 @@ static unsigned long max_stack_size; static arch_spinlock_t max_stack_lock = (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; -static int stack_trace_disabled __read_mostly; static DEFINE_PER_CPU(int, trace_active); static DEFINE_MUTEX(stack_sysctl_mutex); @@ -115,9 +114,6 @@ stack_trace_call(unsigned long ip, unsigned long parent_ip) { int cpu; - if (unlikely(!ftrace_enabled || stack_trace_disabled)) - return; - preempt_disable_notrace(); cpu = raw_smp_processor_id();