From: Yuanhan Liu Subject: Re: [PATCH] drm/i915: Add aub debug support for kernel Date: Mon, 08 Nov 2010 17:23:28 +0800 Message-ID: <1289208208.31912.81.camel@snb-beast.sh.intel.com> References: <1288689096-23230-1-git-send-email-yuanhan.liu@intel.com> <849307$a7if4n@azsmga001.ch.intel.com> <5b55a1$ij0t3g@fmsmga002.fm.intel.com> <5b55a1$ijdg71@fmsmga002.fm.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C1449E78C for ; Mon, 8 Nov 2010 01:23:14 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org I just send two patches out, without trace on load patch for now(explained at below). On Mon, 2010-11-08 at 00:03 +0800, Chris Wilson wrote: > Oh my, this turns out to be quite hacky indeed... > > if (i915_trace_on_load) { > const struct ftrace_event_call enable_list[] = { > #define EVENT(name) event_call_##name > &EVENT(i915_reg), > NULL, > }, *call = enable_list; > do { > if ((*call)->class->reg(*call, TRACE_REG_REGISTER) == 0) > (*call)->flags |= TRACE_EVENT_FL_ENABLED; > else > DRM_DEBUG("failed to enable tracepoint '%s'\n", > (*call)->name); > } while (*++call); > } > > [Not even compile tested! ;)] Sorry, it can't compile for not being able to find the event_call_*. While, that doesn't matter. As you may know, I send a patch to upstream to export trace_set_clr_event function. Then we can simply add the following line in i915_init(): trace_set_clr_event("i915", "i915_reg_rw", 1) then the i915:i915_reg_rw event is enabled at the load time. While, I am not saying I am waiting upstream to receive that patch. I mean we can hold on for a while: I think the trace-event can export some more friendly interface for enabling specified event at module load time. (I might make some patches if I have time). Thanks. > > That would seem to do the trick. The alternative would be to override the > use of trace_event_raw_init in the include/trace/ftrace.h macros. In light > of that the above seems much simpler. > -Chris >