From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754134AbbAYRer (ORCPT ); Sun, 25 Jan 2015 12:34:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51368 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753976AbbAYReo (ORCPT ); Sun, 25 Jan 2015 12:34:44 -0500 Date: Sun, 25 Jan 2015 18:34:33 +0100 From: Jiri Olsa To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Jiri Olsa , Arnaldo Carvalho de Melo , Masami Hiramatsu , Namhyung Kim Subject: Re: [PATCH 5/5] perf: Make perf aware of tracefs Message-ID: <20150125173433.GA10390@krava.brq.redhat.com> References: <20150124181330.195149364@goodmis.org> <20150124181449.157590751@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150124181449.157590751@goodmis.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 24, 2015 at 01:13:35PM -0500, Steven Rostedt wrote: SNIP > @@ -351,11 +385,15 @@ const char *find_tracing_dir(void) > if (tracing_found) > return tracing; > > - debugfs = find_debugfs(); > - if (!debugfs) > - return NULL; > + debugfs = find_tracefs(); > + if (!debugfs) { > + tracing_dir = "/tracing"; > + debugfs = find_debugfs(); > + if (!debugfs) > + return NULL; so this pattern 'try tracefs, if that does not work try debugfs' is all over the patch.. how about we add new new 'virtual' fs to encapsulate that, like: with followign interface: bool tpfs_configured(void); const char *tpfs_find_mountpoint(void); int tpfs_valid_mountpoint(const char *debugfs); char *tpfs_mount(const char *mountpoint); extern char tpfs_mountpoint[]; It does not neceserily needs to reside in tools/lib/api/fs/tpfs.[ch], but I believe we need some form of encapsulation for this. jirka