From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751667AbcBNQpm (ORCPT ); Sun, 14 Feb 2016 11:45:42 -0500 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.228]:22472 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751634AbcBNQpl (ORCPT ); Sun, 14 Feb 2016 11:45:41 -0500 Date: Sun, 14 Feb 2016 11:45:37 -0500 From: Steven Rostedt To: Denis Kirjanov Cc: linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com Subject: Re: [PATCH 1/2] tracing/mm: don't trace kfree on offline CPUs Message-ID: <20160214114537.79a6dbb3@grimm.local.home> In-Reply-To: <1455387773-4245-1-git-send-email-kda@linux-powerpc.org> References: <1455387773-4245-1-git-send-email-kda@linux-powerpc.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.29; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 13 Feb 2016 21:22:52 +0300 Denis Kirjanov wrote: > -DEFINE_EVENT(kmem_free, kfree, > +DEFINE_EVENT_CONDITION(kmem_free, kfree, > > TP_PROTO(unsigned long call_site, const void *ptr), > > - TP_ARGS(call_site, ptr) > + TP_ARGS(call_site, ptr), > + > + /* > + * This trace can be potentially called from an offlined cpu. > + * Since trace points use RCU and RCU should not be used from > + * offline cpus, filter such calls out. > + * While this trace can be called from a preemptable section, > + * it has no impact on the condition since tasks can migrate > + * only from online cpus to other online cpus. Thus its safe > + * to use raw_smp_processor_id. > + */ > + TP_CONDITION(cpu_online(raw_smp_processor_id())) This is starting to become a common occurrence. Perhaps it is best to just hardcode this into the tracepoint code itself? -- Steve > ); > > DEFINE_EVENT_CONDITION(kmem_free, kmem_cache_free,