Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3066439lqz; Wed, 3 Apr 2024 18:10:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjV3P7Ep1pIJ3FqassjNUyy9m1VKD2UnJyhxVU0MH7oz9mfJjE4bcegg5v/EyZiA0CMty0oeTFjbe3l4D6M7pLx8Kl1EXjRVAy4t2mKw== X-Google-Smtp-Source: AGHT+IFsJIuGsVQ3my6or3EWVVczKVXKuFNonXZebSR9b38CzH51JDgrFv3IBr+B4c4DiRNsVMZT X-Received: by 2002:a05:6808:648f:b0:3c4:1520:e280 with SMTP id fh15-20020a056808648f00b003c41520e280mr1275807oib.9.1712193021896; Wed, 03 Apr 2024 18:10:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712193021; cv=pass; d=google.com; s=arc-20160816; b=kzXshBfP/jESVLecK8QwXc3IwHysJX4FPNvICez2PfV88+2DBnvbkLkcPIWeb4CFTH gAZMNMVhROouLG1obp4GdoqV+JajmNqoLiQxwC8jghnc1MjAjctAr/qOct7p5UqFqNu6 CGsxUmhJXpLLcCLOBWbDPEN9t+nsU//vE2KCrdc8TFK2jhK7/MdwT9UOT7sw+jB2I1QF 6i/A1XEz/4kt4GMs0p06nI1o1cQOrnKY/a2hnzYRpyI7rGbLBv/dl7f58KOF+m3WNPNm TFpP35ULJBxqsyQtPtPKlvMYoWybNrUaBkGEcrj+Ynn9a+QrvAiVMkZrpIye4NsNHXi/ z//g== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=a0WgnYpbpUKZo8YR8XcwNLrT1//n68QLqGA5DCAOQeg=; fh=3x3tXlex1WrU7MDINoo2J4wD3Ncagh0Cl+6FQcHnGI8=; b=kfLWeE9kOgMWk0c6DZCOjscqXbGG9CSooZvfc3IyFL1Gx5r3a6IrnkkmlHCZ6U9gfr vNEZNEvMPVlRxmOkqEKkATG82rfGCq2gUPGOHwZZTE98lA6sApzHTZdzUzU3teuDrHRa x3tlQUcOzspl1OeCVmgjjdzUkDSyW2EUnKRGxJ2bI1h8xRlDEZ51Lln80E4LLynXrpu7 sQHancTeuEaVkx28nHJxSwzmIf4OunK5xqU9XJnn1GluFaN6RWKmvlvTB4WGmbKpNh1f iObecPPWpqcv40gXYcnj3CLxb67nSpKqY6NH9EzqaJDy6NZMSOCx52upVWZSbOSvEKLG tJwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cNV+GggG; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-130807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vr6-20020a05620a55a600b0078a5169d3ffsi14996332qkn.510.2024.04.03.18.10.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 18:10:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cNV+GggG; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linuxfoundation.org dmarc=pass fromdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-130807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 98D9D1C21680 for ; Thu, 4 Apr 2024 01:10:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 128DE848A; Thu, 4 Apr 2024 01:10:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cNV+GggG" Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (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 5C3024C9F for ; Thu, 4 Apr 2024 01:10:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712193014; cv=none; b=KPA8pb/HwouWQNXxJsU+nsJHegraA9DxDqflsX1pJZ0aSylm3Ds8WCvNu587WtDKsU4f0b5mSg5tVZzh8isiygCqzLTmHHY9Rs1sZKHiaTJNzzOnuDgSGbKjVTUmCnGmRvNdFW3xisHg5molRF6P9a6kE2kLFR5pQ6I6UfdafWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712193014; c=relaxed/simple; bh=kC+TSppxAO7zUiJZpluSvGxhmErQAeqtY77z7J8nBmU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=ersbB3g9kpbzCG3qN7msWzDbktaS7/9kTqWppVQv9TNHLF90P7GxPOTBL7uaDgvl1OGp+NCX9Mxa/+PUTRnNVkxtcIqEyH666X/omQmP2xUqepCmtgEIuJQ627Ra6OPx3knGHRzZSxOXc1w+v+BOD0vGGsbaoAt4DNr79T/1Nyc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cNV+GggG; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7d0772bb5ffso9618939f.0 for ; Wed, 03 Apr 2024 18:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1712193011; x=1712797811; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=a0WgnYpbpUKZo8YR8XcwNLrT1//n68QLqGA5DCAOQeg=; b=cNV+GggGtUynK0+YkmH/OlBPqkQXb6oKs0MLX1b7Dn+K/gSI6P0LVn+/8eiDZSoWDu GHug5VrK5wc11iYWucLjGnrdzczr8gbBRNmRr+qjnIpMsvwhbV9alqwRUAk12yirPwfd +NyE+b6VP+P4bC/YefIATBjQIV28TJSedbJZY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712193011; x=1712797811; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a0WgnYpbpUKZo8YR8XcwNLrT1//n68QLqGA5DCAOQeg=; b=XoQDdGCrzwoxLio/9gHiXVYhLglcZb0al2CVCiXK+8HSkZRki4Xfsr0HeBH57DNZQv M0WrsCYKQTYdAxmQOMlpBeT4mnwn6/K5nE0sIEDOaAV0rkx3UhONkYpgTPuNzDq3uFAz /dsr3hrw9pqlk3HZIJ7dNl8QTjkahHqvhahROKry9N8OaMRVtXvIEA24ISQZyLi+bg0J xZyhDlFYlyPOo8yEQHrwwqg5ccYbJuy9IJD/ayd629VZOH12JBH3h+obQ3LdIjgxfAiE LjT5N6oT47JNlXnJ6ouTg8mVxKT7krsash2ecVGSOH6g3LmwLNX3zbxO+E2PHJHtpH9l HMwQ== X-Forwarded-Encrypted: i=1; AJvYcCVkV1tH7any5/x2eMJr5haMarp1/5ghQ4krUKwPyfl7mkhVjThg23F8mDDHk0NYpJopY2FvdcU7KcPsz7jalBfH0v/zwd7izN+B6lvf X-Gm-Message-State: AOJu0Yzi3gIyxbeiT/y5uqyJ3IhKLOQntu6pW4/gkRrEkA5UMcUHtrbD 248ZNLCC/8pB1FxzYbAhSItwpuQVmF5YitiK2I2nucnRuluMCEr3OIZ0o1X+Gxg= X-Received: by 2002:a92:d0d2:0:b0:369:bf80:e367 with SMTP id y18-20020a92d0d2000000b00369bf80e367mr1379949ila.3.1712193011377; Wed, 03 Apr 2024 18:10:11 -0700 (PDT) Received: from shuah-tx13.internal ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id b11-20020a056e02048b00b00369ed8bb1ffsm797178ils.7.2024.04.03.18.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 18:10:11 -0700 (PDT) From: Shuah Khan To: rostedt@goodmis.org Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH] tools/latency-collector: fix -Wformat-security compile warns Date: Wed, 3 Apr 2024 19:10:09 -0600 Message-Id: <20240404011009.32945-1-skhan@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 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: 8bit Fix the following -Wformat-security compile warnings adding missing format arguments: latency-collector.c: In function ‘show_available’: latency-collector.c:938:17: warning: format not a string literal and no format arguments [-Wformat-security] 938 | warnx(no_tracer_msg); | ^~~~~ latency-collector.c:943:17: warning: format not a string literal and no format arguments [-Wformat-security] 943 | warnx(no_latency_tr_msg); | ^~~~~ latency-collector.c: In function ‘find_default_tracer’: latency-collector.c:986:25: warning: format not a string literal and no format arguments [-Wformat-security] 986 | errx(EXIT_FAILURE, no_tracer_msg); | ^~~~ latency-collector.c: In function ‘scan_arguments’: latency-collector.c:1881:33: warning: format not a string literal and no format arguments [-Wformat-security] 1881 | errx(EXIT_FAILURE, no_tracer_msg); | ^~~~ Signed-off-by: Shuah Khan --- tools/tracing/latency/latency-collector.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/tracing/latency/latency-collector.c b/tools/tracing/latency/latency-collector.c index 0fd9c747d396..cf263fe9deaf 100644 --- a/tools/tracing/latency/latency-collector.c +++ b/tools/tracing/latency/latency-collector.c @@ -935,12 +935,12 @@ static void show_available(void) } if (!tracers) { - warnx(no_tracer_msg); + warnx("%s", no_tracer_msg); return; } if (!found) { - warnx(no_latency_tr_msg); + warnx("%s", no_latency_tr_msg); tracefs_list_free(tracers); return; } @@ -983,7 +983,7 @@ static const char *find_default_tracer(void) for (i = 0; relevant_tracers[i]; i++) { valid = tracer_valid(relevant_tracers[i], ¬racer); if (notracer) - errx(EXIT_FAILURE, no_tracer_msg); + errx(EXIT_FAILURE, "%s", no_tracer_msg); if (valid) return relevant_tracers[i]; } @@ -1878,7 +1878,7 @@ static void scan_arguments(int argc, char *argv[]) } valid = tracer_valid(current_tracer, ¬racer); if (notracer) - errx(EXIT_FAILURE, no_tracer_msg); + errx(EXIT_FAILURE, "%s", no_tracer_msg); if (!valid) errx(EXIT_FAILURE, "The tracer %s is not supported by your kernel!\n", current_tracer); -- 2.40.1