Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1558839

Re: [RFC/PATCH] ftrace: Allow to change size of function graph filters

Path csiph.com!news.redatomik.org!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Namhyung Kim <namhyung@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC/PATCH] ftrace: Allow to change size of function graph filters
Date Sat, 14 Jan 2017 05:40:01 +0100
Message-ID <sZoid-1t4-5@gated-at.bofh.it> (permalink)
References <sZ1F0-4HH-17@gated-at.bofh.it> <sZcK6-31P-21@gated-at.bofh.it>
X-Original-To Steven Rostedt <rostedt@goodmis.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mxC4l8xAd2I67TFcxxwr1n2i6MB7spRZvpJeD+xXqGI=; b=mPdBPqJlBA93pdWpvs1+sQegLx3wWt/cZNPbNwlVMGaipALyASZUFVrtLaqXC0HvPq 2o7FmpegTTGJZpmhvLJle2FTFmhFBvMQiajaylEeNTRYig5KGDa1yhI0dVrAlpEve0Nt BuawW0mQDhiZYRtJM4xFLn/y5s7oem94k5TEm8iowpru63zxEmo18Cm90yXqRN7cLzWH jOStHqNwIUGsjWxOJQ3LFDOYTYunAtgfjhW+gXf0tR5JntRNbZdARfE5MjhlVZeyeq7+ Nq92rJwXsgCmn7g2JdXDzRWsGlp8txPz28FRVA8vpqPhQuDMAPF8s1pFk7NRoHOLoJxX 6EJw==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=mxC4l8xAd2I67TFcxxwr1n2i6MB7spRZvpJeD+xXqGI=; b=I2MKiWpJ0eCosEVh6YCCRhPEuck4vseIl2TID5N1sJL34lEwhz9nYjWYKvAg26NkdZ 3QU9AQJBIjyju1rO/zS92dSn9boqSojZD7sznvXmUABKGivm9hnMgd2ikaO5so4KuKfF xT48uWb50N6BGbVMVvH6WAF5Z22QaaQYtWncwbLTI2TIU7Eo1rnJDYVo4KWlLUwXpVDg MNbJHHWr62EsJEdbzLp1f+L/xPYZ3svUGrm7yKpCu5aN38EsdCm6bAQWU8sA1/fVbqJD r6uq1XGks2GM2RoYXRqNeW/yUgsV444biLhHlQEAsxBRkzd2kuHxZjY/rBL+Rzi/LqqY xKnQ==
X-Gm-Message-State AIkVDXKykb0RDv5g1c0JTevrueHj3/TbD5sjQPw2CTi3K2irDAygz0PwqfG1ag9/IXJPrw==
X-Received by 10.99.39.134 with SMTP id n128mr27952830pgn.85.1484367690139; Fri, 13 Jan 2017 20:21:30 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
User-Agent Mutt/1.7.2 (2016-11-26)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 42
Organization linux.* mail to news gateway
X-Original-Cc LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@kernel.org>
X-Original-Date Sat, 14 Jan 2017 13:20:00 +0900
X-Original-Message-ID <20170114042000.GA1735@danjae.aot.lge.com>
X-Original-References <20170113042243.15259-1-namhyung@kernel.org> <20170113111618.53709bf8@gandalf.local.home>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1558839

Show key headers only | View raw


Hi Steve,

On Fri, Jan 13, 2017 at 11:16:18AM -0500, Steven Rostedt wrote:
> On Fri, 13 Jan 2017 13:22:43 +0900
> Namhyung Kim <namhyung@kernel.org> wrote:
> 
> > It's currently fixed to 32 and it ignores when user gives a pattern
> > which match to functions more than the size.  So filtering like all
> > system calls or many functions with common prefix cannot be set all.
> > Not sure this is right though.
> 
> Yes it's small, and there's a reason for it. So I'm giving a
> conditional nack to the patch.
> > 
> > This patch adds 'graph_filter_size' file in the tracefs to adjust the
> > size.  It can be changed only if the current tracer is not set.
> > 
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> 
> The condition is, we need to fix ftrace_graph_addr() first.
> 
> 	for (i = 0; i < ftrace_graph_count; i++) {
> 
> That gets called at every function being traced. See where I'm heading
> with that? ;-)
> 
> We need to create a hash table or binary search first and make that
> function handle a large ftrace_graph_count before implementing your
> patch. Remove the linear search, replace it with either a binary search
> or a hash. But an O(n) algorithm at every function call is out of the
> question.

Fair enough.  I'll try to add a hash table then.

But I'm not sure how to synchronize hash table manipulations.  It
seems synchronize_sched() is not good enough for function graph
tracer, right?  So I limited changing filter size only when no tracer
is used, but is it ok to have the limitation when adding or removing
an entry to/from the table?  If not, what can I do?

Thanks,
Namhyung

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC/PATCH] ftrace: Allow to change size of function graph filters Namhyung Kim <namhyung@kernel.org> - 2017-01-13 05:30 +0100
  Re: [RFC/PATCH] ftrace: Allow to change size of function graph  filters Steven Rostedt <rostedt@goodmis.org> - 2017-01-13 17:20 +0100
    Re: [RFC/PATCH] ftrace: Allow to change size of function graph  filters Namhyung Kim <namhyung@kernel.org> - 2017-01-14 05:40 +0100
      Re: [RFC/PATCH] ftrace: Allow to change size of function graph  filters Steven Rostedt <rostedt@goodmis.org> - 2017-01-14 06:00 +0100

csiph-web