Received: by 10.223.164.202 with SMTP id h10csp1359106wrb; Sat, 11 Nov 2017 05:27:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMYZCcQArcCCVJaa3Ks2fdegM7vBjDPnpeTAgtAtO1APCBP5i4C2aI7957D+z+QZfT+z6Jbg X-Received: by 10.98.213.194 with SMTP id d185mr3883820pfg.107.1510406877132; Sat, 11 Nov 2017 05:27:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510406877; cv=none; d=google.com; s=arc-20160816; b=EJImI0nL5WqwCy6kTKIF7eBYjKg4CcY0Apzh1hQXxKLnRRZPnZMag+XkOkKfkOyGLH cFlYsERzRV/Wg/kFU3dbPObeR+6v1hOuaVPjEwSacj2nbyWfz9/7oGG3dSW+FPvY/CIc QPa/r8vHU/QkQRX0/VUz1oEvk1y0iXx9gKjlzLCoemM0RmKjYEfjIzj/Sud98nUaiVAw 1vPu1QlsfoWWSHenccjUTJSzulnaCSuiytW3I0oVPWKVcprteqvANfAAOMAzofFcJlt6 N9GAexNWFyQjBbcamtxs7Dni1ZCoBu9Tpck/wpWAXPfJTBvzYMlfgq1p2Rbr0MD87N4V D5KQ== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=V8AT2bBr0mwS9rJ7oUz4gl6Yn31M4O5aV44DbzYyDis=; b=dukrmOScfFiNzqSiDMPrg1tYWSSWha3s7e5yEPrUntmZpFQQucogr/tJYvrk30YYTl H66tbhKOE2qxl1iV1KfR7gXEU44AGOtkG9zbYzctp3Np7xXiiz5pH3Z/LkLnB/MqvjVQ NI0puGimk07vu11ddeov7rjFTbJYhHCWWnuEB4b79lOdlXxxJ5OsIxXX2lrovnmF0VQf PhJzz177oH9o64rYF4SEYL33EZfSouofLmSc3PNZDthB1Elz90J2lK0RH3/zGAfYk3ws TW/kJiEIz0gLZk1OMNwyLn6zGQopo1yCvH/tnoBP4wDUEi3M7sWVPFy9/ZRT3cHP5uP2 Jgag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DrWVQ5f0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si178762pff.160.2017.11.11.05.27.45; Sat, 11 Nov 2017 05:27:57 -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=@gmail.com header.s=20161025 header.b=DrWVQ5f0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbdKKN06 (ORCPT + 83 others); Sat, 11 Nov 2017 08:26:58 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:52153 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751019AbdKKN0j (ORCPT ); Sat, 11 Nov 2017 08:26:39 -0500 Received: by mail-it0-f66.google.com with SMTP id o135so4660633itb.0; Sat, 11 Nov 2017 05:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=V8AT2bBr0mwS9rJ7oUz4gl6Yn31M4O5aV44DbzYyDis=; b=DrWVQ5f0qFswuMekCDO3BEn8iLbrRPEvHTUs2HJVS5jMW6MNsgbwAHaRGz/tExXgSx Nom+1GIOTL2rYXmmyY+TXNxwYujqPv1ry7ykEV3W5U7yU32cV8ktmBQBQe2znvUXOW+0 TUH7QHdqusxwyOws3iaIHwN4hNije9sr8lnvIF4Tbn5e07Cy2UzkTdg6tXbkBRCqbH1J 82Iro289/+01k8wHnUIjnUkqyX1zDakeGGhYusU+dJfucDnS3AaIvnZZWOKKJm/p8jz2 qu4qzpv5WR6B1PDRexKKCxzpuIyVxuYIiAIPWEgsf1gS6t/duDgD/z8tZ0aDPJWW/jUx 73rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=V8AT2bBr0mwS9rJ7oUz4gl6Yn31M4O5aV44DbzYyDis=; b=hggaydhAdRAXUOH77ylr1tCQUY4v5D2w+6+BovNoJ2CtGUbgt76qXuhPvA4xBea7aA nDv62qrF1HRku3Ez2A7n21LpqGmB4UvX4FijTthm5pvMpHwRWV7OWx67mQUtqsnx5Sda W6v7GAaCj9bj71b9FzEHsdZGZDP/GxqVKguogxJnb2yH2Xq1DPdmHf7mk+7t5hzRMps6 IomczIASpK9tML81L0hVWWiyGl03q9WRgSWQYPjVcxbfC0zp/6e0md02XgJ4skyrg/Pt CTidmZGwj3t+pVmgFqkxpDx0+LiOuPWJ1/Jt1mOkeNGjPTiigEMR8gDXfDPhZspmH3Y8 dGqw== X-Gm-Message-State: AJaThX6ILsumMAPdAemqeVgA8rGbaWb8Pt1NPHM6JP6v+g1VgYSeVvuD TT88iP57xJlkrmPUr/6Ss/o/bHZRty3dhL1Jru8= X-Received: by 10.36.33.23 with SMTP id e23mr4579093ita.109.1510406799126; Sat, 11 Nov 2017 05:26:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.160.73 with HTTP; Sat, 11 Nov 2017 05:26:38 -0800 (PST) In-Reply-To: <20171110223206.5b5f79d8@gandalf.local.home> References: <1510207298-14828-1-git-send-email-laoar.shao@gmail.com> <20171109064326.skfvvohg7qhgl3lp@ast-mbp> <20171109131808.373c296f@gandalf.local.home> <30A95900-7378-439F-954E-BD5487012435@fb.com> <20171109195712.47fe23b6@gandalf.local.home> <20171110100700.5870c21f@gandalf.local.home> <20171110223206.5b5f79d8@gandalf.local.home> From: Yafang Shao Date: Sat, 11 Nov 2017 13:26:38 +0000 Message-ID: Subject: Re: [PATCH] tcp: Export to userspace the TCP state names for the trace events To: Steven Rostedt Cc: David Miller , Song Liu , Alexei Starovoitov , "mingo@redhat.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-11 3:32 GMT+00:00 Steven Rostedt : > On Sat, 11 Nov 2017 02:06:00 +0000 > Yafang Shao wrote: > >> 2017-11-10 15:07 GMT+00:00 Steven Rostedt : >> > On Fri, 10 Nov 2017 12:56:06 +0800 >> > Yafang Shao wrote: >> > >> >> Could the macro tcp_state_name() be renamed =EF=BC=9F >> >> If is included in include/net/tcp.h, it will >> > >> > Ideally, you don't want to include trace/events/*.h headers in other >> > headers, as they can have side effects if those headers are included i= n >> > other trace/events/*.h headers. >> > >> >> Actually I find trace/events/*.h is included in lots of other headers, >> for example, >> >> net/rxrpc/ar-internal.h > > This is an internal header, so it's not that likely to be used where it > shouldn't be. > >> include/linux/bpf_trace.h >> fs/f2fs/trace.h > > The above two are actually headers specifically used to pull in the > trace/events/*.h headers. > >> fs/afs/internal.h > > another internal header. Unlikely to be misused. > >> arch/x86/include/asm/mmu_context.h > > This one, hmm, probably should be fixed. > >> ... >> >> Are these files doing properly ? > > Most yes, some probably not. > >> Should we fix them ? > > Probably, but if they are used incorrectly, it would usually fail on > build (The same global functions and variables would be defined). > >> >> But per my understanding, it is ok to include trace/events/*.h in >> other headers because we defined TRACE_SYSTEM as well, as a >> consequence those headers should not included in trace/events/*.h. If >> that happens, it may means that one of the these two TRACE_SYSTEM is >> not defined properly. Maybe these two TRACE_SYSTEM should be merged to >> one TRACE_SYSTEM. > > Two different files may have the same TRACE_SYSTEM defined. That's not > an issue. > > The issue is, if you have a trace/events/*.h header in a popular file > (like it use to be in include/linux/slab.h), then it can cause issues > if another trace/events/*.h header includes it. That's because each > trace/events/*.h header must be included with CREATE_TRACE_POINTS only > once. > Understood. Thanks for explanation. >> >> >> >> cause compile error, because there's another function tcp_state_name(= ) >> >> defined in net/netfilter/ipvs/ip_vs_proto_tcp.c. >> >> static const char * tcp_state_name(int state) >> >> { >> >> >> >> if (state >=3D IP_VS_TCP_S_LAST) >> >> >> >> return "ERR!"; >> >> >> >> return tcp_state_name_table[state] ? tcp_state_name_table[sta= te] : "?"; >> >> >> >> } >> > >> > But that said, I didn't make up the trace_state_name(), it was already >> > there in net-next before this patch. >> > >> >> I know that is not your fault. > > :-) > >> But as you are modifying this file, it is better to modify it in your >> patch as well. >> So we need not submit another new patch to fix it. > > I could whip up a patch 2. > >> >> > But yeah, in actuality, I would have just done: >> > >> > #define EM(a) { a, #a }, >> > #define EMe(a) { a, #a } >> > >> > directly. Which we can still do. >> > >> > -- Steve >> > >> >> The suggestion from Song is good to fix it. > > Song's suggestion seems like it can simple be a patch added on top of > mine. As it is somewhat agnostic to the fix I'm making. That is, it's a > different problem, and thus should be a different patch. > Got it. These two issues should be fixed in two different patches :-) Thanks Yafang From 1583738972392359262@xxx Sat Nov 11 03:33:01 +0000 2017 X-GM-THRID: 1583638629223849157 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread