From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753441AbdKJRhV (ORCPT ); Fri, 10 Nov 2017 12:37:21 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:50240 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752625AbdKJRhT (ORCPT ); Fri, 10 Nov 2017 12:37:19 -0500 From: Song Liu To: Steven Rostedt CC: Yafang Shao , David Miller , Alexei Starovoitov , "mingo@redhat.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] tcp: Export to userspace the TCP state names for the trace events Thread-Topic: [PATCH] tcp: Export to userspace the TCP state names for the trace events Thread-Index: AQHTWb7rpqVlVOmK9EOjQBD90xS8/6MNDPAAgACqrwCAACnwAA== Date: Fri, 10 Nov 2017 17:37:08 +0000 Message-ID: <3FA9A41F-9210-45FC-9656-1B8D67CA3E0C@fb.com> 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> In-Reply-To: <20171110100700.5870c21f@gandalf.local.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3273) x-originating-ip: [2620:10d:c090:180::1:1fd1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR15MB1512;20:CZS8vlCI2i643av3W0teuPVHaepNEH9p4sVp+0mv7lE4RM4b0GIlq8Kc40yxMAzWra97j8POaFh5Ocr/FjcVjaIdEaHv/StdmeRviTDXUFjL2R7YLDJwnph/9ZVgHjWTgk5a+y2fB+FbXXHq8bMCP88mENN4KVsABX7MFWpv08c= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 183e6836-4bdf-4ad2-e7ea-08d52861aac7 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603258);SRVR:CY4PR15MB1512; x-ms-traffictypediagnostic: CY4PR15MB1512: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231021)(100000703101)(100105400095)(6041248)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR15MB1512;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR15MB1512; x-forefront-prvs: 0487C0DB7E x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(199003)(189002)(24454002)(54906003)(50986999)(83716003)(2906002)(6916009)(82746002)(86362001)(76176999)(106356001)(57306001)(101416001)(105586002)(6486002)(33656002)(77096006)(14454004)(189998001)(6512007)(229853002)(53546010)(6246003)(316002)(2900100001)(102836003)(4326008)(99286004)(478600001)(5660300001)(93886005)(25786009)(2950100002)(53936002)(3280700002)(81156014)(8936002)(8676002)(81166006)(7736002)(97736004)(3660700001)(6116002)(68736007)(305945005)(50226002)(39060400002)(6506006)(36756003)(6436002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR15MB1512;H:CY4PR15MB1512.namprd15.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <5052D34CF60BA945AAB586B86EA65674@namprd15.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 183e6836-4bdf-4ad2-e7ea-08d52861aac7 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Nov 2017 17:37:08.4022 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1512 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-10_08:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vAAHbPAi019012 > On Nov 10, 2017, at 7:07 AM, Steven Rostedt wrote: > > On Fri, 10 Nov 2017 12:56:06 +0800 > Yafang Shao wrote: > >> Could the macro tcp_state_name() be renamed ? >> 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. > >> 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 >= 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. > > 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 > How about we undef tcp_state_name and tcp_event_names at the end of include/trace/events/tcp.h? Thanks, Song