From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752261AbdC2C3C (ORCPT ); Tue, 28 Mar 2017 22:29:02 -0400 Received: from smtprelay0025.hostedemail.com ([216.40.44.25]:38727 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751801AbdC2C3B (ORCPT ); Tue, 28 Mar 2017 22:29:01 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2736:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:5007:6119:6261:7875:7903:8660:10004:10400:10848:10967:11026:11232:11658:11914:12295:12296:12438:12740:12760:12895:13069:13148:13161:13229:13230:13311:13357:13439:14096:14097:14181:14659:14721:21080:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: seed07_4e22c3ee51415 X-Filterd-Recvd-Size: 2387 Date: Tue, 28 Mar 2017 22:28:55 -0400 From: Steven Rostedt To: Namhyung Kim Cc: Ingo Molnar , Masami Hiramatsu , LKML , kernel-team@lge.com Subject: Re: [PATCH 1/4] ftrace: Fix function pid filter on instances Message-ID: <20170328222855.78af0d53@grimm.local.home> In-Reply-To: <20170329022037.GA19448@sejong> References: <20170329014625.19346-1-namhyung@kernel.org> <20170329014625.19346-2-namhyung@kernel.org> <20170328220841.6823958d@grimm.local.home> <20170329022037.GA19448@sejong> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Mar 2017 11:20:37 +0900 Namhyung Kim wrote: > > Actually, if this is called after event_trace_del_tracer(), the tr is > > already invisible and nothing new should change. > > I don't follow. After event_trace_del_tracer(), the tr is invisible > from the probe of event tracing but still is visible from the probe of > function tracing, right? Well, nothing should be able to get to the set_ftrace_filter file when there. Because of the tr->ref count. But keeping the lock is safer regardless, and it's not a fast path, so the extra overhead if the lock isn't needed is no big deal. > > > > > Make a wrapper around clear_ftrace_pids() and call that instead. We > > don't even need to take a lock, but as I see there's a lockdep test for > > ftrace_lock, we should still do so just to be safe. > > Right, that's why I call ftrace_pid_reset() instead of > clear_ftrace_pids(). So do you prefer adding a new wrapper like below > rather than reusing ftrace_pid_reset() with a new argument? Yes, because the bool passed in is confusing. A separate function like below is more descriptive. -- Steve > > Thanks, > Namhyung > > > > > > void ftrace_clear_pids(struct trace_array *tr) > > { > > mutex_lock(&ftrace_lock); > > > > clear_ftrace_pids(tr); > > > > mutex_unlock(&ftrace_lock); > > }