Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1845222lql; Wed, 13 Mar 2024 09:38:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWiyybMDHS9XHDu7ufUY9TNvuEZ4ly3p6jX06UvR9p5M27XUd5hfSufpcwE+UuXxW+ZnmrX6vkjsEtR8hofFOG4hmZQC8dHg6MGkfdbtQ== X-Google-Smtp-Source: AGHT+IE1f0JZQKnXCY4R2uFl5N7xUyHNIkSNHtWj9pz1FfUkWbSIJ0Ujx71+tWbH7Wi7CroZ5Poq X-Received: by 2002:a50:85c3:0:b0:566:ef8:a81a with SMTP id q3-20020a5085c3000000b005660ef8a81amr5531847edh.7.1710347916012; Wed, 13 Mar 2024 09:38:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710347915; cv=pass; d=google.com; s=arc-20160816; b=yEsmxxz5WFDcQ+lYrORtIA+l8EI6+dJFogPVOKNV0ozM/goJ3iJHKz2ULiMBQeRX0K FHxua0m/Y7xRYMzQI42EDrJ3GAMV30NJjWrHIainDinJlN+cXcyFdoZB3Oy80r0Pi20K HAC3fAOiVz+FOuwSQhl/8mYsSFlX6Rdr08Q6tULEFwU8GdtTK6dTh7hcYz9teFgjx9TF tooLVxM9GzMMS1V87AlDcUst7goyxlj1/deXws9DDlH+dV/GJOBeSbaFfVGbU3Lm1mMU WCkTVihVR2RyVw9NKrxaesGOhI/Jt0iKweYgTaz04eVWGNGw6GpV07p+msUAdXAK2lNU yXww== 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 :date:subject:cc:to:from:dkim-signature; bh=FwdYu/ke8eiKKQR5I78RQ4Zz9kcukCJnmqHQ6ErOf58=; fh=bxvCM9GLuNq0LsJWWvg5JTz/OH5MRLtmItf9v2KMhd8=; b=N/hgkSOaZgrMjtc4YlducnzQg5ZMXF+uHcszWLIxVn+aKjVeJ2A0ZZorx1+dekythv zxKkOZe0rQqaHrFgAgej755BA9Vq1ArgoRwD9po5M/xVFw/W2e8PqOy5Ywjob+kZnc4r 7euX3rxbqGQTJ0iD6HcvwrpfntbpBBsU3nyjBjc68C+zEo7EsuwjMmy/rJBZ2HwFMz4+ CyxeTZHq8GS4/BEHpHpAvq1u8+ZDDdJ4F9HpaKifsy60LoG/537nOvkjpzjC+K527qq8 dBvk5i8U+7bS+RNKdQAHgss6RLDTmq1N4O2VAQ1MzEANelyW+LdFg7XQKR+gsoQBfo4S JtCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hthfsGtx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z21-20020a056402275500b0056899ce83a5si50051edd.128.2024.03.13.09.38.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hthfsGtx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101764-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101764-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 B84631F2156B for ; Wed, 13 Mar 2024 16:38:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 564CA605DA; Wed, 13 Mar 2024 16:33:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hthfsGtx" 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 6ED07604D1; Wed, 13 Mar 2024 16:33:09 +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=1710347589; cv=none; b=Qk4JTqdUdj0JZInD6LpMr5aQbicbRaMp4CgU5RlGYolCeu0Vq8PCY9a9OU+X5lUIPojWG8rGgLBjIgiXDXJccyR4CKy+yste0bmQFOmSx7m/wcr3JCWxu3wCi27DML0P+7aNU2RxlC+Q1ZoQO8IUPPw9DDp+YigS1OrqVD7wHtA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347589; c=relaxed/simple; bh=zVXcsojt3NoTCzwiD8lRVyRUKNBhxrBo3ee7NlCp+A4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FBtduCkeIYBbklR1oh2BLtdOoVqG8FmURzQOAGE1caiuTix505e+gLP5bY6rcBSUFDde378SaD5Pab1EsLnN72ldqtS1y/hAxdzmTQu3Bg+rrzKCjqChSdqERXCEWGtHorOxi1tNSdzRFbTvW5+I0FdEIIZQGh1O4prX9BY4TPY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hthfsGtx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74A73C433F1; Wed, 13 Mar 2024 16:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347589; bh=zVXcsojt3NoTCzwiD8lRVyRUKNBhxrBo3ee7NlCp+A4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hthfsGtxGpG09PCNQ42mGFnp6XR1VG0jXWl6GVFbNFIh+iJsJ2kHycD4Ne2ZotVOn P/63kqiCqyQHEGGTbGXBTKq4QZH2xnUhAifXauWQ/PhfJnZMTDC6viN09yX+fLqUzK QDJ8JCRDwOZF7mC93/dlKllM0o9Pm02AliArcuM3SrkwPdrQhEzf5Z/TkdS0R98E/d R2TIur094+0xvGOAZ39fOQqsVb9VbZ0CsPJi7JaxwYo1721BHWTpbrirCl64dbUr+i bV2r0i1fNeV/6olpuE3wFA7Q1Zl2WX5A3C+5dgU7T6Svu0xuVCFNCay3Ujd8VIG7fg Gz4AMHs0TpeMA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Steven Rostedt (Google)" , Jamal Hadi Salim , "David S . Miller" , Sasha Levin Subject: [PATCH 6.7 25/61] tracing/net_sched: Fix tracepoints that save qdisc_dev() as a string Date: Wed, 13 Mar 2024 12:32:00 -0400 Message-ID: <20240313163236.613880-26-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-1-sashal@kernel.org> 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 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: "Steven Rostedt (Google)" [ Upstream commit 51270d573a8d9dd5afdc7934de97d66c0e14b5fd ] I'm updating __assign_str() and will be removing the second parameter. To make sure that it does not break anything, I make sure that it matches the __string() field, as that is where the string is actually going to be saved in. To make sure there's nothing that breaks, I added a WARN_ON() to make sure that what was used in __string() is the same that is used in __assign_str(). In doing this change, an error was triggered as __assign_str() now expects the string passed in to be a char * value. I instead had the following warning: include/trace/events/qdisc.h: In function ‘trace_event_raw_event_qdisc_reset’: include/trace/events/qdisc.h:91:35: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Werror=incompatible-pointer-types] 91 | __assign_str(dev, qdisc_dev(q)); That's because the qdisc_enqueue() and qdisc_reset() pass in qdisc_dev(q) to __assign_str() and to __string(). But that function returns a pointer to struct net_device and not a string. It appears that these events are just saving the pointer as a string and then reading it as a string as well. Use qdisc_dev(q)->name to save the device instead. Fixes: a34dac0b90552 ("net_sched: add tracepoints for qdisc_reset() and qdisc_destroy()") Signed-off-by: Steven Rostedt (Google) Reviewed-by: Jamal Hadi Salim Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- include/trace/events/qdisc.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/trace/events/qdisc.h b/include/trace/events/qdisc.h index a3995925cb057..1f4258308b967 100644 --- a/include/trace/events/qdisc.h +++ b/include/trace/events/qdisc.h @@ -81,14 +81,14 @@ TRACE_EVENT(qdisc_reset, TP_ARGS(q), TP_STRUCT__entry( - __string( dev, qdisc_dev(q) ) - __string( kind, q->ops->id ) - __field( u32, parent ) - __field( u32, handle ) + __string( dev, qdisc_dev(q)->name ) + __string( kind, q->ops->id ) + __field( u32, parent ) + __field( u32, handle ) ), TP_fast_assign( - __assign_str(dev, qdisc_dev(q)); + __assign_str(dev, qdisc_dev(q)->name); __assign_str(kind, q->ops->id); __entry->parent = q->parent; __entry->handle = q->handle; @@ -106,14 +106,14 @@ TRACE_EVENT(qdisc_destroy, TP_ARGS(q), TP_STRUCT__entry( - __string( dev, qdisc_dev(q) ) - __string( kind, q->ops->id ) - __field( u32, parent ) - __field( u32, handle ) + __string( dev, qdisc_dev(q)->name ) + __string( kind, q->ops->id ) + __field( u32, parent ) + __field( u32, handle ) ), TP_fast_assign( - __assign_str(dev, qdisc_dev(q)); + __assign_str(dev, qdisc_dev(q)->name); __assign_str(kind, q->ops->id); __entry->parent = q->parent; __entry->handle = q->handle; -- 2.43.0