Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp92036imu; Wed, 19 Dec 2018 14:15:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/XVUq7L225tWTBaORUD2Tf0Uu7h7E/1UAyXe1HZdC84OS5KPbdou0sLZW4M4NGiSQy50J1X X-Received: by 2002:a63:1e17:: with SMTP id e23mr20744304pge.130.1545257737012; Wed, 19 Dec 2018 14:15:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545257736; cv=none; d=google.com; s=arc-20160816; b=LcXU2UfYL/xQZ5aJbjqIOcfzjaznswk3f3VMMXYSdxaSKnOOC3HAQTNjRu1MTz1LSb Qq8eYOFA73axH56FEqBq1+ca049U0M5ST3INipptjBt9x8gbxO7dcTJ4QIwe9WK+HrEy fodZXyXMcyHKWcexDw8BME5H8hVozOi9mn24tsXNkt6XYTEfkgtlHGte371ZrScdCnhk 9KqJqV24zQcJdggYOKgFDi/Pgna4RPV+5yNgYI4NF2Axs5xuKT0+6/YR2bEUx6iSsN86 2rNO3Gp0A9QbmVeNhYKsEwL9hrKznZGTZHItay7fQum6tyqs+ehWVTDZNb3f6E5fkPuA 17Ww== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=2WqS9fexQF8rn7tC06yoegd0vNwMHt3PHd4HUCYV+DM=; b=Rh7tIJqbOlnvqNVLjKeVCBsjGVkNsBTekc8ZauqZyzOXSLBhhSAgz0nO0II5UMYHAa v4bX8Gw5vgGzt/70ISCWL8x7kUUwIzmsAk5HaWkD0Ph/3I5kSjnkpfcZbLch4HvikJNo jWVmSYi33pJs/Q2Jwl/htMWofZwwd6u1/RotxdtRT3q1UX03CeB7pOnaeLUel6EBROIt Rf4H/gPOTh93jsnPjgZakdpzUbuyxXzVU63P/tpvwD4RBdgYQPggGwaiJmfCyeZCjDf6 +3tGl0BWdU8Hy2rHa70YN09wY4F4pXqpFcVMtCxj4rDGO5CyrY+x7MW2Gm+6Gs0cJvY4 QtjQ== ARC-Authentication-Results: i=1; mx.google.com; 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 2si16788462pgj.104.2018.12.19.14.15.21; Wed, 19 Dec 2018 14:15:36 -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; 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 S1730462AbeLSVDW (ORCPT + 99 others); Wed, 19 Dec 2018 16:03:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:53512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730418AbeLSVDV (ORCPT ); Wed, 19 Dec 2018 16:03:21 -0500 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 62BF42070B; Wed, 19 Dec 2018 21:03:19 +0000 (UTC) Date: Wed, 19 Dec 2018 16:03:17 -0500 From: Steven Rostedt To: Joe Perches Cc: Tom Zanussi , tglx@linutronix.de, mhiramat@kernel.org, namhyung@kernel.org, vedang.patel@intel.com, bigeasy@linutronix.de, joel@joelfernandes.org, mathieu.desnoyers@efficios.com, julia@ni.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Subject: Re: [PATCH 2/7] tracing: Change strlen to sizeof for hist trigger static strings Message-ID: <20181219160317.71c3e3ff@gandalf.local.home> In-Reply-To: <426609d1a7c8217187f18011add87ca4fdd54f1e.camel@perches.com> References: <20181219144047.49fabfa6@gandalf.local.home> <1545248809.2396.2.camel@kernel.org> <1545250591.4161.2.camel@kernel.org> <20181219153447.3684100d@gandalf.local.home> <426609d1a7c8217187f18011add87ca4fdd54f1e.camel@perches.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Dec 2018 12:51:59 -0800 Joe Perches wrote: > > #define strncmp_prefix(str, prefix) \ > > strncmp(str, prefix, strlen(prefix)) > > > > in include/linux/string.h > > > > And go around and use that throughout the kernel. By doing a quick > > grep, I already spotted a few bugs. > > I hope you also convert the existing uses like > > strncmp(str1, "str2", 4) > > where the length value is precalculated to the strlen > of the const string Yeah sure. > > But there seem to be _a lot_ of those... > > $ git grep -P "\bstrncmp\s*\([^,]+,[^,]+,\s*\d+\s*\)" | wc -l > 1681 > Right. I'm going to first create the macro and probably just apply it to the tracing directory. Then when the macro is added to the next merge window, I'll post a bunch of patches that clean up the rest of the code. -- Steve