Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3149295lqo; Tue, 21 May 2024 08:11:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXA85itDC179mB785uPYnJxK7owHDRmlHzFSf4JmsWK3Rh25aAKzaLR7o0Sj39i7PPaaAd1bcFB0ER6SZ5W1Gg7OS9Zh+HyikN7vEol/w== X-Google-Smtp-Source: AGHT+IHaNnb0Atf0ZCKBJBL9QQcCEsLrtvOPbnBzuN7UVaPDE+9Yz0foqqIru5250VL3ru/U7QfL X-Received: by 2002:a05:6808:2102:b0:3c9:956b:c738 with SMTP id 5614622812f47-3c9970cec9dmr47729445b6e.43.1716304278555; Tue, 21 May 2024 08:11:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716304278; cv=pass; d=google.com; s=arc-20160816; b=MJw3ssRqSQdbcerXQg4LqelLRu53H1W6awNJzUaz3y+4gqnk66gDiJuIvJJDulgu8T M/3miGDIwTdpqKkZX7yDstCSVx1zdM9mdnu9kEvxWFRUJhkTQQ/8HSL8c8ZOvOKsmSAB ijSM+E9CKZXxb1n9/XaIwXf5HfPrhuehVDIQMNeqzf6Q2OdF1x282VVMQAhyMoFu6dKt 9av7QK3xCS+d8i+kOUy378rm+gjzM6H7BwiPTkASbnlNDhbV0DxziK7SBR+4FDZk4Rbf 1t4T1uZOlvnLpWIYm5fsK6/lvZpeNu+3avKnAS/fbqOm8f11fwvteULemNgj0w5AnI3W nD7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=0+THa20LYhJBIMoEUx57FLG+qkSqmFpeSpCtcp5cbto=; fh=Z5xnpge5/b/yrQ4f364N5eUaSqQwhhup2wVllsKBY9s=; b=0WhwdhVrR48I5k8CTC19Y9VGUXKeE0DfRCZPFXbO9A5stVRjq8e5jxugOHRC56pjs6 5QDzMk5HQQ9PxZ5L/8IVXTeYUcqABqJmPukZ6zsH6rR899JNZG8mGyINZEYDupTxSwwk PKo7HB0PrcBi+2zEm/jsIJ2aujVhEWIUsToJX5drGNf4tISdxvVtHUHxUb7j7fHMPCoP MHUxo7IOVntHMQJU0I9yTP4EmoeVjGZjVKt/P82j4tKWw8UTrGwMWCDkERAH0ReuGAMy Y+y/N0lrhv7wYq6KUcHbNUBviQeXFHpCV9xrhJwCMdftzz/SYZC4KctkDulJsHnqR/wg iuEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b="bOn6K1p/"; 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-185137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185137-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ab6c7108a0si33845816d6.526.2024.05.21.08.11.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 08:11:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b="bOn6K1p/"; 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-185137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185137-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 3758E1C214E6 for ; Tue, 21 May 2024 15:11:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 519D9143C5B; Tue, 21 May 2024 15:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bOn6K1p/" Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (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 D0B8C143890 for ; Tue, 21 May 2024 15:11:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716304271; cv=none; b=HQoGh1UC4XpI128VPyxqDYZdFeWfAQK7fYar8QHLBjgtyA9QA6vBWMDJEyzFH9Ti+tT4A753vIb9d06kdwONGROBYt/pkdeHyh7uV+EKwuE+yrzrA0l+s1nk8ssg8EdoJhZihxokKlM6qG7u6Q89Hn7LawLbzSBe6l+TCSQytpc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716304271; c=relaxed/simple; bh=Y19ApUlNe+i8Mr1MK47nFQt8OHWh56aHjnOdDjWAzy8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BLA+qW6hka87R62aJ9bDJBRdbQNZ/NYOJXR+V9w3hcY1jLOaqkO22EiTlp+J7maMjVrF2B/vKG0cdO9Loy3w71TBSBsQQ1PWIKtPlgQqvJhTP/+sASxMjCbKA3OHv38IMwacTdJiNVnMGuYRRnPxaOypOA1dKTZSw/Vda/gSRYQ= 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=bOn6K1p/; arc=none smtp.client-ip=209.85.166.182 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-il1-f182.google.com with SMTP id e9e14a558f8ab-36dd6cbad62so2308525ab.3 for ; Tue, 21 May 2024 08:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1716304269; x=1716909069; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0+THa20LYhJBIMoEUx57FLG+qkSqmFpeSpCtcp5cbto=; b=bOn6K1p/1IJ/WGMZJVxHU4GNMQxRvB3uVjE/fCN3b7Rt6TbnxkZKE/q918x6SM0/IT XIvv/hZpVm9hVBzaqjtEGEb5ZgTlOdAB3qXpx0OF1XcFyvEN/AbOAHEyjH3JKuw97FO3 Y0hFZutPCEUwtkYoQDu1+QIoaeyG4h61w9G48= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716304269; x=1716909069; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0+THa20LYhJBIMoEUx57FLG+qkSqmFpeSpCtcp5cbto=; b=pdHlmwmW0MfN6TsFDenJQ/GorPVooXr6/9ybLU9hygqYLrDM38rOUiCBWGyyMY9Pxw C49SZemY0LBwD5B6woZPhkIjiPFa+zBZpebZJKXI9mIntQakKmZz+yGvPLdQxIk+M9+i cN9jd6YsJukN8boAxeaOH1pNUEMwl4xOQI/pHMzPoak/UjuVfbB9j8uQcY9oq8i2oit3 yizYKeYh9Z5CgTI8neqIKHUQL/P0JJM6R7xkqE99355e1miC8MjW/ofJ9nA9gD9+vRbl F4R/bRCoFxq6py+xcSz61J0k8KHN2/HG1XDvsjwuBL9KkQhrC3xG4HybRMrU/0OnMvsD n6pg== X-Gm-Message-State: AOJu0Yx3kmsX+2eIyAKZWULiJ4MvuzOsO+t5Ow0b4tl7j1C5E2MssMcA xp4r35aTzJ1VA/egPJNdW9Nnb2iljy+vMTS4Q+rGpE78kKlcflW1UPTb+tn0fAkKSg9s/nHxWgZ 0x6Q= X-Received: by 2002:a92:6e11:0:b0:36d:9ec4:54fb with SMTP id e9e14a558f8ab-36d9ec4574cmr221776915ab.0.1716304269014; Tue, 21 May 2024 08:11:09 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-36cb9d988d6sm64752655ab.43.2024.05.21.08.11.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 May 2024 08:11:08 -0700 (PDT) Message-ID: <466e5359-067c-4ab5-9476-06daa44dc83d@linuxfoundation.org> Date: Tue, 21 May 2024 09:11:08 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tools/latency-collector: fix -Wformat-security compile warns To: rostedt@goodmis.org Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Shuah Khan References: <20240404011009.32945-1-skhan@linuxfoundation.org> Content-Language: en-US From: Shuah Khan In-Reply-To: <20240404011009.32945-1-skhan@linuxfoundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/3/24 19:10, Shuah Khan wrote: > 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); Any thoughts on this patch? thanks, -- Shuah