From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA1212F8EA1 for ; Thu, 28 May 2026 19:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779997982; cv=none; b=vCNBAVj3M1lJBC+cEJIF/IMmkwKZimCi+C2eAYm/x4Oti8JSZ0Yd/UJCbJH8YGB81FDXIpj6isrel5SDpV6EcOy8eWJ7PktGVe0yeY4kaz75YRGIPG+kHp7GpREsp44dM6UrYfk1L7it7QWT2oDAhn1ikNCLZg0M3aQJfq96VXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779997982; c=relaxed/simple; bh=d5ev39DJ7XuMiT1cusC6h0dkjra32XflyVN5uxigsuQ=; h=From:Date:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Al2VAseYFBnXD0UwppaxUN9rnVDwxyubuH9M0jYnfpxxphBLBkBh81HrCT1tfh15yiGtBTqBR+7kFIvWt/G/fGLHNcVuizUDOpD/LXoIHpvWQWhxZ4iKgPHO9oNXWvee/LlQzgSJiMaAywyPqclbdHl8JnhpD9xSD7wYP/jqUQY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=j5qsKGng; arc=none smtp.client-ip=209.85.160.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j5qsKGng" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-516d78df76aso70531441cf.3 for ; Thu, 28 May 2026 12:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779997980; x=1780602780; darn=vger.kernel.org; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:date:from:from:to:cc:subject:date :message-id:reply-to; bh=hSweMU2kbOJPZdesr6FMZ6m/XS+obLaza9k39QjRM/Q=; b=j5qsKGngvBGcXjN7/WKkVPYe0rbro62inoF4VqtpYF9Da5cJMUG34OkkTMB6bG5ioT CvrMydMPr+flnZGf6h5ENwekK68ZzJNGoNBwGfl2PH2lBE4+/v9yhjmirBE4jVB2MES+ uKZkGE8ZXIVuritsLu+k1PG8NyAuAV9GBMwRZhM8nxbpik7LSnQVl4MIyWzK+F7y3em4 m6gza6yeTh/0gZPwHt2CqB6Y+1z9tMBX++8WCupP2jMRb3Tyny6YETjqkHczHvduQkt9 5az5r0ozxEUMI+B90Oed4hetxCTKQXNZfPmDw1lZH4T2NrWnK73KLGQaN7XVOgcxOGYt J6Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779997980; x=1780602780; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:date:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hSweMU2kbOJPZdesr6FMZ6m/XS+obLaza9k39QjRM/Q=; b=kVelQY/kBDa66/kPv6P0aW2NQXzvMoRylrF6+adGBhr6CBtqAijiLGT8eLdQH+dt67 H11HlvbQo2QeR1wHYz1hRWiS3l5LDfBFoqJLWU/516Yzu7h67Hmg3q8AxDtwdoDPwTfX vIXYjD2yV1QXZedDBN/bvnBHa300zsljuVXlt24pznTnM56KAE/cPXR5gFrqITVFUJl/ Y6TGpVhtrL1ZZmJAQKy7Gq/dQutAZpux37dIOFTXCqIQqx8Y6PiZwk91CjKZy0/df564 mbJ8R9GoeS7ijRG6Azd797mWFW+KZt6f1dgSGUFfEW8PoTsZf/XxiW1pkdU17xsMD7f4 c7DA== X-Forwarded-Encrypted: i=1; AFNElJ+O5c1Zmv3bVJ7bjkQs5++y/Yh/AF4dk6XuVIa2JoBWO8y9pqDaFzrvHtpuLYnQsaIVv8OJhcO4nry1F20=@vger.kernel.org X-Gm-Message-State: AOJu0YwftXaJxDDekbRD+Xz1E9IRpjVKD8UxR496mwiRwqASRZUDQ7k0 nYgeZCMXJ20CdzgucxtJlGtoYoNq0lEj7jqbMIFqWbSWnTz44lD832Sz X-Gm-Gg: Acq92OFi8e2LcrLK7OUOI2AgX1jM4gwmrSCE60ttzVG3rLdc5eQOq04fbMMb6uMjInL wJ3LPkAVKRMoDcSSPGf6efzK8CAuaJIpoGq4VPEFezogeVs/vU8TaiZHhhFyAsCVfJp+D3JBIS+ +pqULisvrc7eH6ziHzGn6rI2qNThdxZUtfloTR8h7PGMgdNY/I98hlirv1P63sYILFLwIMRoyYr GHVFZu+ma0uYzCT0ylNbSwNSctJbhXWDmAJ8g4eMNYrg4qwDEYWhgq6X3lGNG6sWGDNarXHDLjN Z6YUDRrCvdHY6+P2S5R3k66+xsgKIrW5Nn6jsvylk8f7iEPB6cnyTWyleaUAcsx/8EYtZ5pUab1 pd1WErEmjPNOcKxv4zc9vNPSvzTzenfeNLVyZTrc7kpCEedxjyTizJN3EFGTUhJ52goMBY7kcXE vFgo9QjkZIrOaRwY6WynB4RLm4csya X-Received: by 2002:a05:622a:40c3:b0:516:dbf6:f8e7 with SMTP id d75a77b69052e-5172cb69340mr4244601cf.17.1779997979567; Thu, 28 May 2026 12:52:59 -0700 (PDT) Received: from localhost ([2804:388:90d1:6ac3:6adf:ec45:d26:cc54]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51706b066e5sm81085101cf.26.2026.05.28.12.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 12:52:58 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Date: Thu, 28 May 2026 16:52:55 -0300 To: Namhyung Kim Cc: Adrian Hunter , Ian Rogers , James Clark , Jiri Olsa , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Subject: [PATCH 1/1] perf tests hwmon_pmu: Use PRIu64 + (u64) cast for a __u64 field to work more widely Message-ID: 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-Disposition: inline Content-Transfer-Encoding: 8bit While testing perf with an updated Debian experimental cross compiler (gcc version 14.2.0 (Debian 14.2.0-13)) this started failing: In file included from tests/hwmon_pmu.c:12: tests/hwmon_pmu.c: In function 'do_test': tests/hwmon_pmu.c:199:34: error: format '%lld' expects argument of type 'long long int', but argument 7 has type '__u64' {aka 'long unsigned int'} [-Werror=format=] 199 | pr_debug("FAILED %s:%d Unexpected config for '%s', %lld != %ld\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /git/perf-7.1.0-rc5/tools/perf/util/debug.h:20:21: note: in definition of macro 'pr_fmt' 20 | #define pr_fmt(fmt) fmt | ^~~ tests/hwmon_pmu.c:199:25: note: in expansion of macro 'pr_debug' 199 | pr_debug("FAILED %s:%d Unexpected config for '%s', %lld != %ld\n", | ^~~~~~~~ tests/hwmon_pmu.c:199:79: note: format string is defined here 199 | pr_debug("FAILED %s:%d Unexpected config for '%s', %lld != %ld\n", | ~~~^ | | | long long int | %ld LD /tmp/build/perf/util/intel-pt-decoder/perf-util-in.o The usual make that %lld a PRIu64 (since arg7 is evsel->core.attr.config, which is a __u64) but then on Fedora 44 (gcc version 16.1.1 20260515 (Red Hat 16.1.1-2)) it ends up with: In file included from tests/hwmon_pmu.c:13: tests/hwmon_pmu.c: In function ‘do_test’: tests/hwmon_pmu.c:200:34: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘__u64’ {aka ‘long long unsigned int’} [-Werror=format=] 200 | pr_debug("FAILED %s:%d Unexpected config for '%s', %" PRIu64 " != %ld\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/acme/git/perf-tools-next2/tools/perf/util/debug.h:20:21: note: in definition of macro ‘pr_fmt’ 20 | #define pr_fmt(fmt) fmt | ^~~ tests/hwmon_pmu.c:200:25: note: in expansion of macro ‘pr_debug’ 200 | pr_debug("FAILED %s:%d Unexpected config for '%s', %" PRIu64 " != %ld\n", | ^~~~~~~~ cc1: all warnings being treated as errors So the way to satisfy both compilers is to also add a (u64) cast to arg7. Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/hwmon_pmu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/hwmon_pmu.c b/tools/perf/tests/hwmon_pmu.c index ada6e445c4c41e1b..870d59c0f7cba2e7 100644 --- a/tools/perf/tests/hwmon_pmu.c +++ b/tools/perf/tests/hwmon_pmu.c @@ -2,6 +2,7 @@ #include "hwmon_pmu.h" #include +#include #include #include @@ -196,9 +197,9 @@ static int do_test(size_t i, bool with_pmu, bool with_alias) continue; if (evsel->core.attr.config != (u64)test_events[i].key.type_and_num) { - pr_debug("FAILED %s:%d Unexpected config for '%s', %lld != %ld\n", + pr_debug("FAILED %s:%d Unexpected config for '%s', %" PRIu64 " != %ld\n", __FILE__, __LINE__, str, - evsel->core.attr.config, + (u64)evsel->core.attr.config, test_events[i].key.type_and_num); ret = TEST_FAIL; goto out; -- 2.54.0