From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Senozhatsky Subject: Re: [PATCH 2/2] mm/page_ref: add tracepoint to track down page reference manipulation Date: Mon, 15 Feb 2016 14:28:55 +0900 Message-ID: <20160215052855.GA2010@swordfish> References: <1455505490-12376-1-git-send-email-iamjoonsoo.kim@lge.com> <1455505490-12376-2-git-send-email-iamjoonsoo.kim@lge.com> <20160215050858.GA556@swordfish> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20160215050858.GA556@swordfish> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sergey Senozhatsky Cc: js1304-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Andrew Morton , Michal Nazarewicz , Minchan Kim , Mel Gorman , Vlastimil Babka , "Kirill A. Shutemov" , Steven Rostedt , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Joonsoo Kim List-Id: linux-api@vger.kernel.org On (02/15/16 14:08), Sergey Senozhatsky wrote: > > will this compile with !CONFIG_TRACEPOINTS config? > uh.. sorry, was composed in email client. seems the correct way to do it is +#if defined CONFIG_DEBUG_PAGE_REF && defined CONFIG_TRACEPOINTS #include #define page_ref_tracepoint_active(t) static_key_false(&(t).key) extern struct tracepoint __tracepoint_page_ref_set; ... extern void __page_ref_set(struct page *page, int v); ... #else #define page_ref_tracepoint_active(t) false static inline void __page_ref_set(struct page *page, int v) { } ... #endif or add a dependency of PAGE_REF on CONFIG_TRACEPOINTS in Kconfig. -ss From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f169.google.com (mail-pf0-f169.google.com [209.85.192.169]) by kanga.kvack.org (Postfix) with ESMTP id B93A76B0005 for ; Mon, 15 Feb 2016 00:27:39 -0500 (EST) Received: by mail-pf0-f169.google.com with SMTP id q63so81288942pfb.0 for ; Sun, 14 Feb 2016 21:27:39 -0800 (PST) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com. [2607:f8b0:400e:c00::243]) by mx.google.com with ESMTPS id y11si36333277pfi.175.2016.02.14.21.27.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Feb 2016 21:27:39 -0800 (PST) Received: by mail-pf0-x243.google.com with SMTP id e127so7039152pfe.3 for ; Sun, 14 Feb 2016 21:27:39 -0800 (PST) Date: Mon, 15 Feb 2016 14:28:55 +0900 From: Sergey Senozhatsky Subject: Re: [PATCH 2/2] mm/page_ref: add tracepoint to track down page reference manipulation Message-ID: <20160215052855.GA2010@swordfish> References: <1455505490-12376-1-git-send-email-iamjoonsoo.kim@lge.com> <1455505490-12376-2-git-send-email-iamjoonsoo.kim@lge.com> <20160215050858.GA556@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160215050858.GA556@swordfish> Sender: owner-linux-mm@kvack.org List-ID: To: Sergey Senozhatsky Cc: js1304@gmail.com, Andrew Morton , Michal Nazarewicz , Minchan Kim , Mel Gorman , Vlastimil Babka , "Kirill A. Shutemov" , Steven Rostedt , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Joonsoo Kim On (02/15/16 14:08), Sergey Senozhatsky wrote: > > will this compile with !CONFIG_TRACEPOINTS config? > uh.. sorry, was composed in email client. seems the correct way to do it is +#if defined CONFIG_DEBUG_PAGE_REF && defined CONFIG_TRACEPOINTS #include #define page_ref_tracepoint_active(t) static_key_false(&(t).key) extern struct tracepoint __tracepoint_page_ref_set; ... extern void __page_ref_set(struct page *page, int v); ... #else #define page_ref_tracepoint_active(t) false static inline void __page_ref_set(struct page *page, int v) { } ... #endif or add a dependency of PAGE_REF on CONFIG_TRACEPOINTS in Kconfig. -ss -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752159AbcBOF1m (ORCPT ); Mon, 15 Feb 2016 00:27:42 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36782 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbcBOF1j (ORCPT ); Mon, 15 Feb 2016 00:27:39 -0500 Date: Mon, 15 Feb 2016 14:28:55 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky Cc: js1304@gmail.com, Andrew Morton , Michal Nazarewicz , Minchan Kim , Mel Gorman , Vlastimil Babka , "Kirill A. Shutemov" , Steven Rostedt , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Joonsoo Kim Subject: Re: [PATCH 2/2] mm/page_ref: add tracepoint to track down page reference manipulation Message-ID: <20160215052855.GA2010@swordfish> References: <1455505490-12376-1-git-send-email-iamjoonsoo.kim@lge.com> <1455505490-12376-2-git-send-email-iamjoonsoo.kim@lge.com> <20160215050858.GA556@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160215050858.GA556@swordfish> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (02/15/16 14:08), Sergey Senozhatsky wrote: > > will this compile with !CONFIG_TRACEPOINTS config? > uh.. sorry, was composed in email client. seems the correct way to do it is +#if defined CONFIG_DEBUG_PAGE_REF && defined CONFIG_TRACEPOINTS #include #define page_ref_tracepoint_active(t) static_key_false(&(t).key) extern struct tracepoint __tracepoint_page_ref_set; ... extern void __page_ref_set(struct page *page, int v); ... #else #define page_ref_tracepoint_active(t) false static inline void __page_ref_set(struct page *page, int v) { } ... #endif or add a dependency of PAGE_REF on CONFIG_TRACEPOINTS in Kconfig. -ss