Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp200226lqb; Thu, 14 Mar 2024 08:58:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQeZpOCrwpMf+6LawkCPNlmNF7cTPL2GZqc3/9PjXRAjafyJUaKTIqnfJFfoXemeX+fItPtXLDBHXVXnE0v2vG9TnLAPTVWQUvhXXIkg== X-Google-Smtp-Source: AGHT+IFpFU1dhCPnz6Hv+gremhZeCL3RxAhk5Oj+TbiCVlvu5zL6izppT81l7Z/gr1MddxSdC2gi X-Received: by 2002:a50:871b:0:b0:567:a2c7:27b4 with SMTP id i27-20020a50871b000000b00567a2c727b4mr5692680edb.5.1710431910117; Thu, 14 Mar 2024 08:58:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710431910; cv=pass; d=google.com; s=arc-20160816; b=Tpx0woCIOqDBWp499x8Hu7eaE7Xrjkfe9+kNgTASZT7+drtuto2z8dOvLCs6UdE7qu ADMpBrRet/fL6Tc1wsMMnXB4d7Hqh6Dz76BwBCq2L/86NuFdKCSSbgBoM6QKl38DMTNe xKBiBbs0ircMU8utgnedDM8Qq96XHiXfvUdjMH3ayxS4cg5KjChqd8QrpvJhDGD2yzEy 7sMVfecD+SQ1916gDfC0858ll74Jb23ERSJQh5sxrjRspgjogKv1eLRMxlqIs4vFiJS6 AO/aZjDWeWgKnnxYXILs1jlvRpUqHDMwpa29cyE76AfpQRfyDfPVVH+JJHjLJbQjy8Xu 6T7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=kBMElspIl3M22Ba7osATTQESXlwKBs+9/f4lXraqh3o=; fh=vw3pxi6D19cvwoIeA6tFbZwtlSmT4nlw6M1hFO1KqFU=; b=IMfqS3Jqb256O0v81htnxBb9u3H9A9D2DfKmOcHm/M9sYJooK4Vq1KuGgUBN4r2xQj LOmSMa0Zuo7eIVd4sxshb0b8TpLFGu9NTqnaw0baLVD7B/Z6q6ylojqX1KxXZxdcL3iM NZVieUtnnJsz/+VKEbCkvsY+2yBH/7T/9fxElyRYkVehkNzqPJPY/o+6mgtFDbFCUsz7 Ma0wopnG3Ipq6hW50DjehC1Xy4dfZqyu8sP52VHTzMwH+kEi3cqA9kFC1kwe5XZd0mWX Y4XpBqXJFATZKyZhjrQgF3Onkx9+TSD3+6v8tUNuMxtyHW7/WaIYgtv5/4K9YB+TiX2e sPRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-103535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103535-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c8-20020a0564021f8800b0056766365c44si866458edc.256.2024.03.14.08.58.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 08:58:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-103535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103535-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D03BF1F22685 for ; Thu, 14 Mar 2024 15:58:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E69C77319A; Thu, 14 Mar 2024 15:58:18 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6652071B37; Thu, 14 Mar 2024 15:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710431898; cv=none; b=J5F43Ik6WRv6bk84HdqmJaJFrkKtnSLFjUWcmI3BBqC+UWFN423mFb/w6TVqKoXnxNQTUjn2nfcckRaorFNcHvoghW+++yOGYOFiOI6ZdsCVHp6/Tzdv2uYBUAtToCEGS++oADR7FgKxC6/hKgBr70UqMJ9jQW/Z6rSnTmc0Q4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710431898; c=relaxed/simple; bh=DXQqwJJ63DZa7xAit6S7SqD2kBPUmGIXS/NWXgZYEwA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kCkNn9ETjCf6CiXzS3ovC7Y8ngSgqgNR/2nUIFZ2MGHdFdko01znAitKCow9QC/bKLB8nCofB6Zxzs1DXkZCV6w18GQnj3T1eHqEwJ3CqJOsKYgA0ue/90YwO7rKqYG5fJ6aCQ0WvOOGPOi6cdTsXf9Pqti9J2RQE6RFmctJNK0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E21BC433C7; Thu, 14 Mar 2024 15:58:16 +0000 (UTC) Date: Thu, 14 Mar 2024 12:00:27 -0400 From: Steven Rostedt To: Paolo Abeni Cc: LKML , Linux Trace Kernel , netdev , Yisen Zhuang , Salil Mehta , Jijie Shao , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Yufeng Mo , Huazhong Tan Subject: Re: [PATCH] net: hns3: tracing: fix hclgevf trace event strings Message-ID: <20240314120027.088e850d@gandalf.local.home> In-Reply-To: <8607787b42e80503e0259f41e0bcc2d3ff770355.camel@redhat.com> References: <20240313093454.3909afe7@gandalf.local.home> <8607787b42e80503e0259f41e0bcc2d3ff770355.camel@redhat.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 14 Mar 2024 15:39:28 +0100 Paolo Abeni wrote: > On Wed, 2024-03-13 at 09:34 -0400, Steven Rostedt wrote: > > From: "Steven Rostedt (Google)" > >=20 > > [ > > Note, I need to take this patch through my tree, so I'm looking for = acks. =20 >=20 > Note that this device driver is changing quite rapidly, so I expect > some conflicts here later. I guess Liuns will have to handle them ;) Well, it merges fine with linux-next and linus's current master. ;-) >=20 > > This causes the build to fail when I add the __assign_str() check, w= hich > > I was about to push to Linus, but it breaks allmodconfig due to this= error. > > ] > >=20 > > The __string() and __assign_str() helper macros of the TRACE_EVENT() ma= cro > > are going through some optimizations where only the source string of > > __string() will be used and the __assign_str() source will be ignored a= nd > > later removed. > >=20 > > To make sure that there's no issues, a new check is added between the > > __string() src argument and the __assign_str() src argument that does a > > strcmp() to make sure they are the same string. > >=20 > > The hclgevf trace events have: > >=20 > > __assign_str(devname, &hdev->nic.kinfo.netdev->name); > >=20 > > Which triggers the warning: > >=20 > > hclgevf_trace.h:34:39: error: passing argument 1 of =E2=80=98strcmp=E2= =80=99 from incompatible pointer type [-Werror=3Dincompatible-pointer-types] > > 34 | __assign_str(devname, &hdev->nic.kinfo.netdev->= name); > > [..] > > arch/x86/include/asm/string_64.h:75:24: note: expected =E2=80=98const c= har *=E2=80=99 but argument is of type =E2=80=98char (*)[16]=E2=80=99 > > 75 | int strcmp(const char *cs, const char *ct); > > | ~~~~~~~~~~~~^~ > >=20 > >=20 > > Because __assign_str() now has: > >=20 > > WARN_ON_ONCE(__builtin_constant_p(src) ? \ > > strcmp((src), __data_offsets.dst##_ptr_) : \ > > (src) !=3D __data_offsets.dst##_ptr_); \ > >=20 > > The problem is the '&' on hdev->nic.kinfo.netdev->name. That's because > > that name is: > >=20 > > char name[IFNAMSIZ] > >=20 > > Where passing an address '&' of a char array is not compatible with str= cmp(). > >=20 > > The '&' is not necessary, remove it. > >=20 > > Fixes: d8355240cf8fb ("net: hns3: add trace event support for PF/VF mai= lbox") =20 >=20 > checkpactch in strict mode complains the hash is not 12 char long. Hmm, I wonder why my git blame gives me 13 characters in the sha. (I cut and pasted it from git blame). My git config has: [core] =20 abbrev =3D 12 >=20 > > Signed-off-by: Steven Rostedt (Google) =20 >=20 > FWIW >=20 > Acked-by: Paolo Abeni Thanks! -- Steve