From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751680AbcHGKgZ (ORCPT ); Sun, 7 Aug 2016 06:36:25 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:34857 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569AbcHGKgY convert rfc822-to-8bit (ORCPT ); Sun, 7 Aug 2016 06:36:24 -0400 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [PATCH 1/2] mm: page_alloc.c: Add tracepoints for slowpath From: Janani Ravichandran In-Reply-To: <20160805123034.75fae008@gandalf.local.home> Date: Sun, 7 Aug 2016 16:06:18 +0530 Cc: Janani Ravichandran , linux-mm@kvack.org, linux-kernel@vger.kernel.org, riel@surriel.com, akpm@linux-foundation.org, hannes@compxchg.org, vdavydov@virtuozzo.com, mhocko@suse.com, vbabka@suse.cz, mgorman@techsingularity.net, kirill.shutemov@linux.intel.com, bywxiaobai@163.com Content-Transfer-Encoding: 8BIT Message-Id: <93BEB5B5-321C-429B-9B87-40F8B499E45D@gmail.com> References: <6b12aed89ad75cb2b3525a24265fa1d622409b42.1469629027.git.janani.rvchndrn@gmail.com> <20160727112303.11409a4e@gandalf.local.home> <0AF03F78-AA34-4531-899A-EA1076B6B3A1@gmail.com> <20160804111946.6cbbd30b@gandalf.local.home> <9D639468-2A70-4620-8BF5-C8B2FBB38A99@gmail.com> <20160805123034.75fae008@gandalf.local.home> To: Steven Rostedt X-Mailer: Apple Mail (2.2104) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Aug 5, 2016, at 10:00 PM, Steven Rostedt wrote: > >> > > You probably want to clear the trace here, or set function_graph here > first. Because the function graph starts writing to the buffer > immediately. > I did that, just didn’t include it here :) >> > > When threshold is set, the entry is not recorded, because it is only > showing the exit and the time it took in that function: > > 0) kswapd0-52 | + 54.141 us | } /* shrink_zone */ > > shrink_zone() took 54.141us. > > The reason it doesn't record the entry is because it would fill the > entire buffer, if the threshold is never hit. One can't predict the > time in a function when you first enter that function. Right! > >> > > You need your own interpreter here. Perhaps a module that either reads > the tracepoints directly and registers a function graph tracer itself. > The trace events and function tracers are plugable. You don't need to > use the tracing system to use them. Just hook into them directly. > > Things like the wakeup latency tracer does this. Look at > kernel/trace/trace_sched_wakeup.c for an example. It hooks into the > sched_wakeup and sched_switch tracepoints, and also has a way to use > function and function_graph tracing. > > I will look at that file. Thanks! > >> > > Great! And note, even if you add extra tracepoints, you can hook > directly into them too. Again, see the trace_sched_wakeup.c for > examples. Alright. Thanks for all the help! :) Janani. > > -- Steve