Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755427AbYC1ADg (ORCPT ); Thu, 27 Mar 2008 20:03:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753979AbYC1ADS (ORCPT ); Thu, 27 Mar 2008 20:03:18 -0400 Received: from fk-out-0910.google.com ([209.85.128.186]:8248 "EHLO fk-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753833AbYC1ADR (ORCPT ); Thu, 27 Mar 2008 20:03:17 -0400 From: Denys Vlasenko To: Mathieu Desnoyers Subject: Re: [patch for 2.6.26 0/7] Architecture Independent Markers Date: Fri, 28 Mar 2008 01:01:29 +0100 User-Agent: KMail/1.8.2 Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org References: <20080327132057.449831367@polymtl.ca> In-Reply-To: <20080327132057.449831367@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803280101.30026.vda.linux@googlemail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2424 Lines: 48 On Thursday 27 March 2008 14:20, Mathieu Desnoyers wrote: > Hi Andrew, > > After a few RFC rounds, I propose these markers for 2.6.26. They include > work done after comments from the memory management community. Most of them have > been used by the LTTng project for about 2 years. Not in this patch, but I noticed: #define __trace_mark(name, call_private, format, args...) \ do { \ static const char __mstrtab_##name[] \ __attribute__((section("__markers_strings"))) \ = #name "\0" format; \ static struct marker __mark_##name \ __attribute__((section("__markers"), aligned(8))) = \ { __mstrtab_##name, &__mstrtab_##name[sizeof(#name)], \ 0, 0, marker_probe_cb, \ { __mark_empty_function, NULL}, NULL }; \ __mark_check_format(format, ## args); \ if (unlikely(__mark_##name.state)) { \ (*__mark_##name.call) \ (&__mark_##name, call_private, \ format, ## args); \ } \ } while (0) In this call: (*__mark_##name.call) \ (&__mark_##name, call_private, \ format, ## args); \ you make gcc allocate duplicate format string. You can use &__mstrtab_##name[sizeof(#name)] instead since it holds the same string, or drop ", format," above and "const char *fmt" from here: void (*call)(const struct marker *mdata, /* Probe wrapper */ void *call_private, const char *fmt, ...); since mdata->format is the same and all callees which need it can take it there. -- vda -- 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/