Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp25083imu; Thu, 6 Dec 2018 18:23:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/UVyGrR2tGIO/QHJnSJ+uxFWyDjvIN2BKsvf7IvklAuadShW69AiJQEMMCmXLL19m8r4sx5 X-Received: by 2002:a17:902:12f:: with SMTP id 44mr454422plb.74.1544149415235; Thu, 06 Dec 2018 18:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544149415; cv=none; d=google.com; s=arc-20160816; b=BjsOeu2pcwqE0wVrGvfTnbZlMSlA2SbX55K7188RlfhaC3XmHwLtar1EAWZ4HPkE1R Y0vawU7Cj5j+V829BxDahN9Cgj0vlmKWmj1LMpsPhqq+1Op8DPiB5hle9u9NH4Tg5m6F vnnvEISpQkBGClccSKUv7TUSeI2ivk+CJ2o2/Hm6l/lX+0726eXg4oPlylpksx0ugsQK l1+QlAtubp1tC4bsw8frbef3G5ZmhqiwbX29dsPIzJfIQTbDWtzMm/+p7DeqA/H6dGGT DFlxG4shu+lr4tvyNov426sZ+fjULKI29h/lgwu5/X83uP8GYdQ+0lGOvhRgkpv8e1CO Gjjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=RnfDr0zmy47SpgMRvrWJ966Vc9lLsTgnPHlBPUUtaR8=; b=crWnwvqkWbj1SiINocLvnx2Ixwh0W9sIot6RgFqYxWs835/IU1r5M7iXem8hLtunYy MIplUITReSHZ5TfIvm6lRPV8o4S227PpFe+dSkExJdnTaXhu3b8jKMatldnrf1+cJpqC eAEKj5WEHR1C62DeaC3LaVRfBCvtMxMqRG0t+Nea4VlVqKzdysBS35fPk2ktwfD+s5LZ 3h7J7Mvcn3Maxi/Lhric15ubEm6jS1MNflqMXYvn5254efPuvRwfcAk+cgYngAyCVM6C geqh/BHwMuin+gjlVD8HLHIVb7xJ5x4vwTxS/nj6DSxdUAh5vKNmxqBhSYR0qn0Uv0OO 5AyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="2YRQ/EPa"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si1659856pgk.127.2018.12.06.18.23.10; Thu, 06 Dec 2018 18:23:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="2YRQ/EPa"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725988AbeLGCWd (ORCPT + 99 others); Thu, 6 Dec 2018 21:22:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:58326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbeLGCWd (ORCPT ); Thu, 6 Dec 2018 21:22:33 -0500 Received: from devnote (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 64C0A2083D; Fri, 7 Dec 2018 02:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544149352; bh=wsR8xlCQ/MuoVh9wNLdj3jzIywHShzJCHzZoePq7/tc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=2YRQ/EPabpVU/2rdnTahEeRbaJmB6VbY3haBLRNl5ZrTVVgAjehBmsEgskROQhXql GShGW30eTF0Gp/VqZaw+V5IHA540KBWo+5h9LhqJelZckFMTMmAHgH7+8TFf3lxNi6 9QYz1BzYr3xJiLKv/GJBGfvyDwEIJqDPak4oAziM= Date: Fri, 7 Dec 2018 11:22:29 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Tom Zanussi , Ravi Bangoria Subject: Re: [PATCH v2 10/12] tracing: Remove orphaned trace_add/remove_event_call functions Message-Id: <20181207112229.ee3f875b46d54d99fbd47c9f@kernel.org> In-Reply-To: <20181204135120.02361a89@vmware.local.home> References: <154140838606.17322.15294184388075458777.stgit@devbox> <154140866955.17322.2081425494660638846.stgit@devbox> <20181204135120.02361a89@vmware.local.home> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Dec 2018 13:51:20 -0500 Steven Rostedt wrote: > On Mon, 5 Nov 2018 18:04:29 +0900 > Masami Hiramatsu wrote: > > > Remove trace_add_event_call() and trace_remove_event_call() > > functions since those are not used anymore. > > > > Signed-off-by: Masami Hiramatsu > > Hi Masami, > > I've applied the series locally (need to test it) except for this > patch. Honestly, I hate the "_nolock" name, and it makes no sense when > > 1) they still grab locks > 2) there's no version without "_nolock" Agreed. > > I added this patch in its place: That looks good to me too. I thought to add similar patch, but just waited for the comment. Acked-by: Masami Hiramatsu Thank you! > > -- Steve > > From: "Steven Rostedt (VMware)" > Date: Tue, 4 Dec 2018 13:35:45 -0500 > Subject: [PATCH] tracing: Consolidate trace_add/remove_event_call back to the > nolock functions > > The trace_add/remove_event_call_nolock() functions were added to allow > the tace_add/remove_event_call() code be called when the event_mutex > lock was already taken. Now that all callers are done within the > event_mutex, there's no reason to have two different interfaces. > > Remove the current wrapper trace_add/remove_event_call()s and rename the > _nolock versions back to the original names. > > Link: http://lkml.kernel.org/r/154140866955.17322.2081425494660638846.stgit@devbox > > Signed-off-by: Steven Rostedt (VMware) > --- > include/linux/trace_events.h | 2 -- > kernel/trace/trace_events.c | 30 ++++-------------------------- > kernel/trace/trace_events_hist.c | 6 +++--- > kernel/trace/trace_kprobe.c | 4 ++-- > kernel/trace/trace_uprobe.c | 4 ++-- > 5 files changed, 11 insertions(+), 35 deletions(-) > > diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h > index 3aa05593a53f..4130a5497d40 100644 > --- a/include/linux/trace_events.h > +++ b/include/linux/trace_events.h > @@ -529,8 +529,6 @@ extern int trace_event_raw_init(struct trace_event_call *call); > extern int trace_define_field(struct trace_event_call *call, const char *type, > const char *name, int offset, int size, > int is_signed, int filter_type); > -extern int trace_add_event_call_nolock(struct trace_event_call *call); > -extern int trace_remove_event_call_nolock(struct trace_event_call *call); > extern int trace_add_event_call(struct trace_event_call *call); > extern int trace_remove_event_call(struct trace_event_call *call); > extern int trace_event_get_offsets(struct trace_event_call *call); > diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c > index a3b157f689ee..bd0162c0467c 100644 > --- a/kernel/trace/trace_events.c > +++ b/kernel/trace/trace_events.c > @@ -2305,7 +2305,8 @@ __trace_early_add_new_event(struct trace_event_call *call, > struct ftrace_module_file_ops; > static void __add_event_to_tracers(struct trace_event_call *call); > > -int trace_add_event_call_nolock(struct trace_event_call *call) > +/* Add an additional event_call dynamically */ > +int trace_add_event_call(struct trace_event_call *call) > { > int ret; > lockdep_assert_held(&event_mutex); > @@ -2320,17 +2321,6 @@ int trace_add_event_call_nolock(struct trace_event_call *call) > return ret; > } > > -/* Add an additional event_call dynamically */ > -int trace_add_event_call(struct trace_event_call *call) > -{ > - int ret; > - > - mutex_lock(&event_mutex); > - ret = trace_add_event_call_nolock(call); > - mutex_unlock(&event_mutex); > - return ret; > -} > - > /* > * Must be called under locking of trace_types_lock, event_mutex and > * trace_event_sem. > @@ -2376,8 +2366,8 @@ static int probe_remove_event_call(struct trace_event_call *call) > return 0; > } > > -/* no event_mutex version */ > -int trace_remove_event_call_nolock(struct trace_event_call *call) > +/* Remove an event_call */ > +int trace_remove_event_call(struct trace_event_call *call) > { > int ret; > > @@ -2392,18 +2382,6 @@ int trace_remove_event_call_nolock(struct trace_event_call *call) > return ret; > } > > -/* Remove an event_call */ > -int trace_remove_event_call(struct trace_event_call *call) > -{ > - int ret; > - > - mutex_lock(&event_mutex); > - ret = trace_remove_event_call_nolock(call); > - mutex_unlock(&event_mutex); > - > - return ret; > -} > - > #define for_each_event(event, start, end) \ > for (event = start; \ > (unsigned long)event < (unsigned long)end; \ > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c > index 21e4954375a1..82e72c48a5a9 100644 > --- a/kernel/trace/trace_events_hist.c > +++ b/kernel/trace/trace_events_hist.c > @@ -960,7 +960,7 @@ static int register_synth_event(struct synth_event *event) > call->data = event; > call->tp = event->tp; > > - ret = trace_add_event_call_nolock(call); > + ret = trace_add_event_call(call); > if (ret) { > pr_warn("Failed to register synthetic event: %s\n", > trace_event_name(call)); > @@ -969,7 +969,7 @@ static int register_synth_event(struct synth_event *event) > > ret = set_synth_event_print_fmt(call); > if (ret < 0) { > - trace_remove_event_call_nolock(call); > + trace_remove_event_call(call); > goto err; > } > out: > @@ -984,7 +984,7 @@ static int unregister_synth_event(struct synth_event *event) > struct trace_event_call *call = &event->call; > int ret; > > - ret = trace_remove_event_call_nolock(call); > + ret = trace_remove_event_call(call); > > return ret; > } > diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c > index bdf8c2ad5152..0e0f7b8024fb 100644 > --- a/kernel/trace/trace_kprobe.c > +++ b/kernel/trace/trace_kprobe.c > @@ -1353,7 +1353,7 @@ static int register_kprobe_event(struct trace_kprobe *tk) > kfree(call->print_fmt); > return -ENODEV; > } > - ret = trace_add_event_call_nolock(call); > + ret = trace_add_event_call(call); > if (ret) { > pr_info("Failed to register kprobe event: %s\n", > trace_event_name(call)); > @@ -1368,7 +1368,7 @@ static int unregister_kprobe_event(struct trace_kprobe *tk) > int ret; > > /* tp->event is unregistered in trace_remove_event_call() */ > - ret = trace_remove_event_call_nolock(&tk->tp.call); > + ret = trace_remove_event_call(&tk->tp.call); > if (!ret) > kfree(tk->tp.call.print_fmt); > return ret; > diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c > index 4a7b21c891f3..e335576b9411 100644 > --- a/kernel/trace/trace_uprobe.c > +++ b/kernel/trace/trace_uprobe.c > @@ -1320,7 +1320,7 @@ static int register_uprobe_event(struct trace_uprobe *tu) > return -ENODEV; > } > > - ret = trace_add_event_call_nolock(call); > + ret = trace_add_event_call(call); > > if (ret) { > pr_info("Failed to register uprobe event: %s\n", > @@ -1337,7 +1337,7 @@ static int unregister_uprobe_event(struct trace_uprobe *tu) > int ret; > > /* tu->event is unregistered in trace_remove_event_call() */ > - ret = trace_remove_event_call_nolock(&tu->tp.call); > + ret = trace_remove_event_call(&tu->tp.call); > if (ret) > return ret; > kfree(tu->tp.call.print_fmt); > -- > 2.19.2 > -- Masami Hiramatsu