Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp446323pxk; Wed, 9 Sep 2020 09:23:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya8ysIJ9zN40JIYRUzxf5gmw8O5ZCKkbMY7YmGDUFGWxhX3JHdAw/vRtqbS12jsz872Y2R X-Received: by 2002:a05:6402:1773:: with SMTP id da19mr4688062edb.171.1599668596241; Wed, 09 Sep 2020 09:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599668596; cv=none; d=google.com; s=arc-20160816; b=U3ouicW6WT4afMrHnz/Fic5QhlZwE5J+Rbd6OJ8db3XG9khOv1hxcXP4giO7kqkA3g /rw3M6zY+zMYFj+Glf2Vg1frOnCwEB2TuJu5XNKa+Fe3KsBSt7/kAeo3/xQ6EXfh/2Vt 4U+DO1LN4soIf9p85xEkfC5ZIc0k4boPW5Nkc5+8z6Sk78iIYZoQrmpuO1dLasLb2WiL v49GOl1aIssTUkFNRdUHJ7llP14EQCjHwtnof6cAYjxYydSoWMZlFz3qnztIj8Y5qGoU 7gmjMZEc539E4C/dwSoiUU569tagSH5lUr1LdsamQ4brizb5zsIYyXPLPTxK+X+b0ONL Q+sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=LkoSSq8WPACZ/QHWA4I24uXK2makUJpC8Vvbzb8/Mzw=; b=L4k19TncFHoPa6uNx36os81EdmR5QPCtx4edRVb14NuHMVinQ6GYWsfC4XggErzXvs RF8vBSZitQw9stvezDTwRFs8yPpQKIwn/zVIwWhk5CtvArqcwpUtDfr3OWMfPYAMpq7u VtZ0v0pfY3Ie+L2HMnyrgUzJfC7MYNX0+h17iZ4RLQDrTNMEjARlsk6mC8mYguUobz37 C4J+vVbam7GH9ganY/QwbPt4keUhX+qPx/2dD/ghxslXfRf1IQZNKrzUEMuovDXvAHjX XVKVq3p0WrvpfFwmS3b1fhSjGLslHkGCzMWN1z5pPG4ge109kVe5U+7Fqw7LiSXxl7gv wqsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=OyTvZbHb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si1638035ejb.340.2020.09.09.09.22.53; Wed, 09 Sep 2020 09:23:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=OyTvZbHb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730776AbgIIQWL (ORCPT + 99 others); Wed, 9 Sep 2020 12:22:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730975AbgIIQUD (ORCPT ); Wed, 9 Sep 2020 12:20:03 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 901BEC061756 for ; Wed, 9 Sep 2020 09:19:36 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id y6so2920472oie.5 for ; Wed, 09 Sep 2020 09:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=LkoSSq8WPACZ/QHWA4I24uXK2makUJpC8Vvbzb8/Mzw=; b=OyTvZbHbIWZ+X76naLRjHS4Y4vdrWG3SfSw4OVldHx1EhCcoo0ebTkKE3013opJoGX WslRB3cGvqmZHxVUjKMPuWk0gZEQP1aYyX2e3gcn/yUg1NbxWAlWqOkZD1ZD2Ag48mj4 eik+jw4qlvzuGFUmfhf0h5BwndBKYQA0exeXU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LkoSSq8WPACZ/QHWA4I24uXK2makUJpC8Vvbzb8/Mzw=; b=hzMSHz1491xH80GAeVxELJ6fyejJedwiM5ymDczlBpQQ5FGKv5ByzLDJLLS6ePH113 H4dd+XDCq7DfWhIEH3tjk8FDVdVcOMsWMRV29Y32YvqU0W70dNZBK+nkEIPd+h7/OSoj v+yOH6IQIb8wTL6D6lpNjwSi+HKs/+73O/VCpl1jNjWX78TODTfGfYs9azuMvKHNf+21 /4ppSQxUr/+dEVPziiwYxcQKCoyn4ovuA4mtUOEjQ6oa2ckzB9yneD0WIKTCIoZuNB/R XAMo2dqBuHfqTJAj8FUDLWgUHGLFFXmYP7IiDhKGuFZhuornFMNXIYtkkzkyJk35Uzj2 tsBA== X-Gm-Message-State: AOAM533C9BS3TBpa8gh7YHK0s3wCagipA3EH8vLcJTKGPENPNsHPbbXO vIe6q5itB1NRlF/uEgyNRtZUUA== X-Received: by 2002:aca:d885:: with SMTP id p127mr1165992oig.1.1599668376019; Wed, 09 Sep 2020 09:19:36 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id j18sm434490otr.12.2020.09.09.09.19.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Sep 2020 09:19:35 -0700 (PDT) Subject: Re: [PATCH] kernel: events: Use scnprintf() in show_pmu_*() instead of snprintf() To: Alexander Shishkin , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, jolsa@redhat.com, namhyung@kernel.org Cc: linux-kernel@vger.kernel.org, Shuah Khan References: <20200901234930.359126-1-skhan@linuxfoundation.org> <87o8mfxxc4.fsf@ashishki-desk.ger.corp.intel.com> From: Shuah Khan Message-ID: Date: Wed, 9 Sep 2020 10:19:34 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87o8mfxxc4.fsf@ashishki-desk.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/9/20 12:45 AM, Alexander Shishkin wrote: > Shuah Khan writes: > >> Since snprintf() returns would-be-output size instead of the actual >> output size, replace it with scnprintf(), so the nr_addr_filters_show(), >> type_show(), and perf_event_mux_interval_ms_show() routines return the >> actual size. > > Well, firstly they should just be sprintf()s, and secondly, I wouldn't > worry about it, because [0]. scnprintf() or sprinf() could be used. > > [0] https://marc.info/?l=linux-kernel&m=159874491103969&w=2 Awesome. Thanks for the pointer. I wasn't aware of this work and it takes care of the problem kernel wide. A better way to solve the problem. thanks, -- Shuah