Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1367352imu; Fri, 9 Nov 2018 15:32:31 -0800 (PST) X-Google-Smtp-Source: AJdET5epFLm7OVh91AkbBeWEqlnShjl3ILTwQ78f69cjMNTdtuQud/R+ONevoD74fvirigoMyoEn X-Received: by 2002:a65:610e:: with SMTP id z14-v6mr9321990pgu.138.1541806351002; Fri, 09 Nov 2018 15:32:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541806350; cv=none; d=google.com; s=arc-20160816; b=Ll50hA779K+hWmjQUsacjDLZkTxkTekoTgb5p25FWKS0er63y9QXBwaqXAgTrmEf9d egRpuvV4ymNG0qt0722jTCwcwiAmx6CbHWzcderiaen4dOJQ5JSRcWk64kiG7u+ykAbl eZSOxEx2m5NdYoRIG+b+28EQd7aByT1haU5/FUirnBOpVT+KpyzNrOJu36NJBD1/4RCS v8DCYHiIfwwEX2JysU5jweFkbZ/0IyU6ByfNNDhF3PJjXYy4UtBjJ6iesilOLBwh+QYT WUQLyuNYxPPmJIhv+Zrey85nslD1QXAHqWz5VOQo9h68UbBX1WJOpyjokAwm4o88CSoX TgZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Z0l0SdMTYNNTHU04lMS5cs5ZttICkchRvRart0qeZJY=; b=xPEV/6OGas2fDN2uRIDybJhimpL9z+Uhu+hzLZ5urZo/zc/Z6gQU+FCa6rjF9xcUhz 3uMzXfg7+IX3yp4ZE31TMjLXGvDf0iQ6NC/rwXRcYveArcnD+xjDC/J/bFuJFNSLf8ic uFPrbuJ7Lx0rMVQQ1HtNljPLt1Kp5ltgFkBlntI2P7x2dhCszV2idsGLm5H00YtJEqbq s86Pa+D0xesR010LGYkNB7sDN8jQuGkqi1e/LcESp8p2umav3Orn0sP5u2hGrvLyjqCx xlUXvb+O9VdSDeo14/6F7S5stS9Po7QT16E86BNYOoqYAz8Y+UcSH57Y0s7pL0jlUTgj GQuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=ZeTXhse9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si8054940pgb.231.2018.11.09.15.32.14; Fri, 09 Nov 2018 15:32:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=ZeTXhse9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbeKJJOk (ORCPT + 99 others); Sat, 10 Nov 2018 04:14:40 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38629 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbeKJJOj (ORCPT ); Sat, 10 Nov 2018 04:14:39 -0500 Received: by mail-lj1-f196.google.com with SMTP id q186-v6so2997126ljb.5 for ; Fri, 09 Nov 2018 15:31:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Z0l0SdMTYNNTHU04lMS5cs5ZttICkchRvRart0qeZJY=; b=ZeTXhse9O5xoFXb/D/v3EfJBV0FkmCr5V41lSDwsKQd4FXxsiBAJ0KX0Fmkicr6zBY FFF23OqwWj6eHFeurSeSlIF5KVYtSZkHdIU+adRNKyYxpmiQAFelNxdOYHOPE6Sz2OHQ 7h1VrJGqhTEc5NV+n+cIBONj1V7RsNbCczRvU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Z0l0SdMTYNNTHU04lMS5cs5ZttICkchRvRart0qeZJY=; b=CPXjd7FuuL1CWyyb035fqRmVYLhAkynsVnGJdQ3LM1VUKkahU2+c4AByrcBQBVm9n7 02H8Vt4YtJ58oFdGQQLY9kJOmQV6kJTkgUm1/bSYhCatVGbCWcBapZVjDN/wEdujDzjG RyaL0bh245VJ1Vtg1hvEptqBl224XbIA2qe7D59FhC+zpJjjw3JuHynf8GnCpOoNQk/f eppDdLVoi4m7HDbpwBXqrYgKGh5TOQ3eQfx8pSV4/OivWQLYqj1wIVuEHFgbFV8MyUjy O1qG2t/JzMlZF+EqeXqnmPnJBGk4DH2fo2WNUP2WaZqKJjGOFxKmGyk/58LAqDGGIs9V KSSQ== X-Gm-Message-State: AGRZ1gJsRgLgec26ol9DH0Xy1mKOcnkM265JE4oPfyFi/SPwArraux1q 68QoZVf9JwvuRabPR8HNnCzJjg== X-Received: by 2002:a2e:4745:: with SMTP id u66-v6mr6540665lja.37.1541806310375; Fri, 09 Nov 2018 15:31:50 -0800 (PST) Received: from [192.168.0.189] (dhcp-5-186-114-252.cgn.ip.fibianet.dk. [5.186.114.252]) by smtp.gmail.com with ESMTPSA id h2sm1666692lfb.49.2018.11.09.15.31.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 15:31:49 -0800 (PST) Subject: Re: [PATCH v3 04/23] linux/net.h: use unique identifier for each struct _ddebug To: Joe Perches , Rasmus Villemoes , Andrew Morton , Jason Baron Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20181009112013.14238-1-linux@rasmusvillemoes.dk> <20181109231021.11658-1-linux@rasmusvillemoes.dk> <20181109231021.11658-5-linux@rasmusvillemoes.dk> <2358250f27022be9eb5c4e6a3d95ee869c3af45f.camel@perches.com> From: Rasmus Villemoes Message-ID: Date: Sat, 10 Nov 2018 00:31:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <2358250f27022be9eb5c4e6a3d95ee869c3af45f.camel@perches.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/11/2018 00.22, Joe Perches wrote: > On Sat, 2018-11-10 at 00:10 +0100, Rasmus Villemoes wrote: >> Changes on x86-64 later in this series require that all struct _ddebug >> descriptors in a translation unit uses distinct identifiers. Realize >> that for net_dbg_ratelimited by generating such an identifier via >> __UNIQUE_ID and pass that to an extra level of macros. >> >> No functional change. > > Why does this require an extra indirection _? > Because the identifier used in the >> DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); line must be the same as the one in the >> if (DYNAMIC_DEBUG_BRANCH(descriptor) && line. That identifier used to be simply "descriptor", with C scope rules making that ok. But because of the asm games I'm playing later, I need to generate a fresh identifier for each instance. That identifier must be referenced in two places in the C source - hence the need to use an extra level of macros to have the __UNIQUE_ID() expanded before _net_dbg_ratelimited gets expanded. More or less every use of __UNIQUE_ID requires such an extra level (because one very rarely needs to use an identifier exactly once - the point of giving stuff a name is to refer to it again.) Rasmus