Received: by 10.223.164.202 with SMTP id h10csp903196wrb; Fri, 10 Nov 2017 18:07:14 -0800 (PST) X-Google-Smtp-Source: AGs4zMa2Yvib/xnHc4W8ACI914FNgRVzy3gqe5lGlForpKHhZBFiA4R8VhIlB7LTaoXkVZ8mevDY X-Received: by 10.99.188.9 with SMTP id q9mr2191057pge.104.1510366034353; Fri, 10 Nov 2017 18:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510366034; cv=none; d=google.com; s=arc-20160816; b=eWh/QSKbtDMeGebxrZ06VXcAcq7Inbo1ccvFORDIoCZ1mxyWiv2NAAXIohTTyQ9txM 32W8h/MzPWZGdH9OAzNVKBnShS7ywSl1cZq9hh5Zdyk47gXqw8tudoe4z+5PWnAEcRqG VB+PeFQW+ZJCEIBtV0JTlyXm5pW7nksYT88Y/p4LDee2VOqlFXyX4e28Vx7854pb4ivm C9s4s4j8Qh2LCldEMSV3ZwupmttrXUsgGGMpTjBhPt4ReYhzTboKqJmyUvVEZHOMyipX MS/hQXHOJmjAhYP5S2PsJ/rugrlMUfk9DnTI72+q9hUwflRPcwFV97o+vJRq6cvK5oMZ uTZQ== 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=QkfXAC25BjKN03WtibSt9bs0o8oYUmmUGynE/RN65ao=; b=DCwaU3nAZlOPAhjb8952tuFkzVn0mbo8/jb8Gp0gZ9mlrsKlUaYPqPdVhwSoUgNPxy BhQAJq2UO5EVOl/APUSY+tEtUHjl6D6wQcdqm7ONhxkYNimuOh5Mm9LMwL/qtHGlo/9V i/AQSRKwYXE7EUXvtQQPSoHbzn2tOKCtGx6UIGa1Pu/aRJOPmfO+O/lZbu0vk7guysP2 idBuB0n/RuVTs9SPodEaijH5YwUMQGKE0iE5opXbLRoM/ZNdPmF7uDuD//bP2N5XyOc8 4lYjCKYxQ1jp2H6aH2B8lbQ73adrijJOeL9cpsgOrfTg/sLW9zUZbUGMvNmdYwgpNHcJ GR4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kD8oC0L4; 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 j15si9844714pgs.319.2017.11.10.18.06.54; Fri, 10 Nov 2017 18:07:14 -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=kD8oC0L4; 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 S1754827AbdKKCGE (ORCPT + 83 others); Fri, 10 Nov 2017 21:06:04 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:50577 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007AbdKKCGC (ORCPT ); Fri, 10 Nov 2017 21:06:02 -0500 Received: by mail-io0-f194.google.com with SMTP id 97so15412911iok.7; Fri, 10 Nov 2017 18:06:01 -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=QkfXAC25BjKN03WtibSt9bs0o8oYUmmUGynE/RN65ao=; b=kD8oC0L4J2ECyKW8GQN4FRhCt3NDOaY7maQaataeyIw+CwXVFiBUbUDFzkEnI2Wvey FI1XA+PKbPx543QOPiYJFrLN8D20vMSIIBIytYjHWWjli8CoJKFZ7hZ5JwxMfAW2BBCc uCll8HHIBGjFId1qwSxB2ddG2+sbkxuxavTBwdXB+YAxw7qR00yQRsJCENdibIFb67dm LGIBAqChKClSA6DRMXUAjr4tBPumnOJaoajl3fCUcPoIowzRvLNkHeHsh2SL6gR0GwJS IzT3R8p9hp7Dm9aTp+RUoEnU2tifLExb+DKk2DKmTe7hk6+fE8BjwOFW0TC3rWMrVs3I 8RXQ== 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=QkfXAC25BjKN03WtibSt9bs0o8oYUmmUGynE/RN65ao=; b=UCLEyHUcpF1Kpgd7A5tkdHik4jagk8n1YzffWINuPgLT4FXTgnRAWHpr7Ko6cwJQrv CGGTmMrjZshDSb1/pLH5OM77v91Q6dlrlTywAUALa/sTdFQkX7S6My2JNPJETpSPS6sK tl4Byi6oQ2Zv65mcSGlcXsSvA80aPsfZFrGp/RbpptszB44PRHdxctnKMKz52eZyXpBg aF6FikKN+EpwgaR+yztmcdp6MfKh0EmHy7qSgJ9AVRlMf0pwJieeCl3KjLmKXDIV96qr ZXZDjauXKU22uigKduZG8WaTyz3ElmVJ+LowRmLu2vkZCakPncH5N1JihEqrHikf8WB7 yySA== X-Gm-Message-State: AJaThX4z/VABBHIEuYT8MaxP8c/j2bcxE3SOP2ccVt8HWBsn1AJ1IAha 8O+qP8fSAiC8pXN/Zr3VUhdaZ82OSQIJ8mRpzJQ= X-Received: by 10.107.20.137 with SMTP id 131mr2662082iou.137.1510365961208; Fri, 10 Nov 2017 18:06:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.160.73 with HTTP; Fri, 10 Nov 2017 18:06:00 -0800 (PST) In-Reply-To: <20171110100700.5870c21f@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> From: Yafang Shao Date: Sat, 11 Nov 2017 02:06:00 +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-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 in > 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 include/linux/bpf_trace.h fs/f2fs/trace.h fs/afs/internal.h arch/x86/include/asm/mmu_context.h ... Are these files doing properly ? Should we fix them ? 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. >> 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[state]= : "?"; >> >> } > > 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. > 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. Thanks Yafang From 1583701547807103322@xxx Fri Nov 10 17:38:10 +0000 2017 X-GM-THRID: 1583638629223849157 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread