Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965322AbZLHAzH (ORCPT ); Mon, 7 Dec 2009 19:55:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965277AbZLHAzG (ORCPT ); Mon, 7 Dec 2009 19:55:06 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:63204 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S965193AbZLHAzF (ORCPT ); Mon, 7 Dec 2009 19:55:05 -0500 Message-ID: <4B1DA3D0.7000002@cn.fujitsu.com> Date: Tue, 08 Dec 2009 08:54:40 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Frederic Weisbecker CC: Ingo Molnar , Steven Rostedt , LKML Subject: Re: [PATCH 01/13] tracing: Extract duplicate ftrace_raw_init_event_foo() References: <4B1CB14A.4080402@cn.fujitsu.com> <4B1CB15F.3000403@cn.fujitsu.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1600 Lines: 37 Frederic Weisbecker wrote: > 2009/12/7 Li Zefan : > >> +static int ftrace_raw_init_event_##call(struct ftrace_event_call *event_call)\ >> +{ \ >> + int id; \ >> + \ >> + id = register_ftrace_event(event_call->event); \ >> + if (!id) \ >> + return -ENODEV; \ >> + event_call->id = id; \ >> + INIT_LIST_HEAD(&event_call->fields); \ >> + return 0; \ >> } > > > This function doesn't vary anymore in this form. > May be can we define a generic one in trace_event.c and only reference > this one? > Ah, you're right. I should have noticed this. I'll make a patch to do this later on. > Or even better, may be can we drop this callback field and statically call this > code when we intialize an event. IIRC, the syscall raw_init_event has the > same callback, may be it's even the same for kprobes events (I can't > check right now). I'll check it. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/