Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp177130rba; Tue, 26 Mar 2024 12:33:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXiXcPIBdQ5c34LOEUsHpnWAXGTLssSvyxjZR88XrZDu18pZ+gUPGUfIX43ZoTVyyp8YOeU09rygSV1+/+DMRhqOB+7d/s5FoQxHP7ulw== X-Google-Smtp-Source: AGHT+IGPGM0H8q/Oa8boRW4rjkbenq9EGJ2/89jPjmzhguFh+IfY2bAHCOBHZkgys9vHM0TIB/Wk X-Received: by 2002:a50:aadc:0:b0:568:d31e:4f94 with SMTP id r28-20020a50aadc000000b00568d31e4f94mr1928545edc.9.1711481589258; Tue, 26 Mar 2024 12:33:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711481589; cv=pass; d=google.com; s=arc-20160816; b=ToszXNiWIy/R4d+JTC1yreQI5mlGgkKhDn5Qc6ILJn5QTCbn2IXIXTbL2Vn2Nw/RDz qI3B+P8oy17DdwcU0u0K/SdChzKHuP6KGGGioomY+TChFUTJNxlFbQSxhTlaNJiXdf9R f+wlRu7q1lyjCahigy/eagwiOCZz9UWXycw2iF9BnIBlS0uY66YlDH+sp6LQtXkPyHSh HblzAy5woZXKY5nTWIO5/kuPwAbnP94ocTyzajkv+0kkFz8hoSgl5qAumPSzewPE1Eqz gYrOwQVqS/3CcTPwxojn2Re1nz8MXAeYzaohGx5F+sa49GXaIEFvXkN4vt641VCphovN Ja4w== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ldMsiEP3mMIpydboV2AKm9Ciyx4AVPzGnmoIpfuSLAY=; fh=KwYv8060D151/z29X0simUAlfVkT6HH+7HmcAzcWMVE=; b=AQ0DaNx05M7fUhJQYewnn8fSVEGAkKxddD7Rb4KgSEkEBsslvJ6L/NTE1ZCCuzH8kR Zt6+5amGlGxjrKrHkQsU+k67RZ9jNUTZ36KlCdMOzI3H+wr8rgwfJC7SSHnpHxhBkgQs sbN1zQJaGIyQ4ZMdW+4v6n9ikbEdgsJ5Re+QwiBBtArUBOISD8guFaCsWdUjx5qQpzQ5 8pUUN31c4b+vdh0EzVze0NeCkNxUnxjhOGAeNu/GxSh0OaLg6OwdTuRP+2pWVoOEtVAY Vtc53YQ7Z3LBQ4VvbIoED4JVofHLQNGP54+5sOQqeqIp36G+meLRHE8PQpEoVars89lt wBFw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=B273VRIJ; 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-119803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 g42-20020a056402322a00b0056c0996dfb7si2704506eda.102.2024.03.26.12.33.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 12:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119803-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=@linuxfoundation.org header.s=google header.b=B273VRIJ; 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-119803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119803-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 60FDA1F87A3B for ; Tue, 26 Mar 2024 19:25:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7D6913D263; Tue, 26 Mar 2024 19:24:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="B273VRIJ" Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (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 C422C13D251 for ; Tue, 26 Mar 2024 19:24:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711481091; cv=none; b=HGMvALRZFukiFDpT+RcWeCJ6fMDOuqh+NtS++zlOky8i1LAtx/smGdbfNOj30KVrRKd41DvvusgGNDaoKZo0Xp8TqV5tM7e579fzYSOR6wk2Xzh+MGAAEj0IAT35UD/RpXO7MCiumHxPkDxpb81Ex2bo1c7lehx3idCd1f7LOd0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711481091; c=relaxed/simple; bh=nJEBYeRpGreh1QGrVI8xb2lqButvSZ322Cq+521//Gw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LFnzQwhEMVxKECBX/1BiCs4BcHqrTlFdZELcYSV8FHhpqYN7qUg01BbVOS3gvzRS4BhbHg7bYfu9RPJRIfdEkNM8hDvfWQ0qXYbMwq9KgmDP+y+wl8SYAPTbDqnq3KSEZn4IOSHn3P+lOtxskmhGN5b5U5MS1FGraSoQih8Wlyo= 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=B273VRIJ; arc=none smtp.client-ip=209.85.166.50 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-f50.google.com with SMTP id ca18e2360f4ac-7cc0e831e11so85594639f.1 for ; Tue, 26 Mar 2024 12:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1711481089; x=1712085889; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ldMsiEP3mMIpydboV2AKm9Ciyx4AVPzGnmoIpfuSLAY=; b=B273VRIJvuaLdT0PcUdpfdXj7ikTwf5++cK/1AeEyiFcAP4cxK4mM7r95Uv9GLcZ9U mdmMmEax/pay4QZNK4/JPbS19fCH7XICDqc7KX39MGMT6xIS4xNdZvO999PyU0uR0s5P TynnZLio/9xEancMrDWcP4XAzEBgBsKQoq1qw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711481089; x=1712085889; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ldMsiEP3mMIpydboV2AKm9Ciyx4AVPzGnmoIpfuSLAY=; b=ttbOvLnqJ9Wk85ebqMs6VnDSqiX6BYzQhl80OIN+xhJLRAZRbW3fTg0Pg7DxZgJbLy GwvWHe6HDUCC7F8Ny6OUNCqyTV7uhASn7P4FvF9uUTLfKhlp3piizHPhcFCGd0pZ4mI6 1r7Syaopf80pWWj+/zrWRRvjIwgRwbjtsRH8V4Sm7IROoqVRW3ufoRGU2n+Ayve8dY1A xK6mV3xGZYV0W3Y8uK8oYCTrAjNAPaWpV+1tCrNpnVRAwF4gaQfSopIN1u3RKeguInM1 /d7fHtZB/PFPStD1FSFeuv+8xR/aGTTohJZ3xIWebIUTjhwkw8lpsfrZeGJYri/KQi9d NkGw== X-Gm-Message-State: AOJu0YyYzzmEtojoDI/6DUEUQmkx/GO1bY6gx9JhrP5lZul/s+SJt3Up 49E/8U3ZM7QE9hfLvG/a1Y2yUDsYhTXwiLC2Mm7+Ty2N9EDY9VYhcunZjuOb9oQ= X-Received: by 2002:a92:dc4f:0:b0:368:a917:168f with SMTP id x15-20020a92dc4f000000b00368a917168fmr1220395ilq.3.1711481088841; Tue, 26 Mar 2024 12:24:48 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id v12-20020a92d24c000000b00366bb13bd89sm3115775ilg.41.2024.03.26.12.24.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Mar 2024 12:24:48 -0700 (PDT) Message-ID: <54e5ac2c-d844-47c2-b811-03d949554515@linuxfoundation.org> Date: Tue, 26 Mar 2024 13:24:47 -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] selftests/ftrace: Fix event filter target_func selection Content-Language: en-US To: "Masami Hiramatsu (Google)" , Mark Rutland , Shuah Khan Cc: linux-kernel@vger.kernel.org, aishwarya.tcv@arm.com, linux-kselftest@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com, rostedt@goodmis.org, Shuah Khan References: <20240320141844.1779984-1-mark.rutland@arm.com> <20240321090950.f96e6b3918bb2dfd121db138@kernel.org> From: Shuah Khan In-Reply-To: <20240321090950.f96e6b3918bb2dfd121db138@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/20/24 18:09, Masami Hiramatsu (Google) wrote: > On Wed, 20 Mar 2024 14:18:44 +0000 > Mark Rutland wrote: > >> The event filter function test has been failing in our internal test >> farm: >> >> | # not ok 33 event filter function - test event filtering on functions >> >> Running the test in verbose mode indicates that this is because the test >> erroneously determines that kmem_cache_free() is the most common caller >> of kmem_cache_free(): >> >> # # + cut -d: -f3 trace >> # # + sed s/call_site=([^+]*)+0x.*/1/ >> # # + sort >> # # + uniq -c >> # # + sort >> # # + tail -n 1 >> # # + sed s/^[ 0-9]*// >> # # + target_func=kmem_cache_free >> >> .. and as kmem_cache_free() doesn't call itself, setting this as the >> filter function for kmem_cache_free() results in no hits, and >> consequently the test fails: >> >> # # + grep kmem_cache_free trace >> # # + grep kmem_cache_free >> # # + wc -l >> # # + hitcnt=0 >> # # + grep kmem_cache_free trace >> # # + grep -v kmem_cache_free >> # # + wc -l >> # # + misscnt=0 >> # # + [ 0 -eq 0 ] >> # # + exit_fail >> >> This seems to be because the system in question has tasks with ':' in >> their name (which a number of kernel worker threads have). These show up >> in the trace, e.g. >> >> test:.sh-1299 [004] ..... 2886.040608: kmem_cache_free: call_site=putname+0xa4/0xc8 ptr=000000000f4d22f4 name=names_cache >> >> .. and so when we try to extact the call_site with: >> >> cut -d: -f3 trace | sed 's/call_site=\([^+]*\)+0x.*/\1/' >> >> .. the 'cut' command will extrace the column containing >> 'kmem_cache_free' rather than the column containing 'call_site=...', and >> the 'sed' command will leave this unchanged. Consequently, the test will >> decide to use 'kmem_cache_free' as the filter function, resulting in the >> failure seen above. >> >> Fix this by matching the 'call_site=' part specifically to extract >> the function name. >> > > Looks good to me. > > Acked-by: Masami Hiramatsu (Google) > > I think this should be a fix because test task name can have ':'. > > Fixes: eb50d0f250e9 ("selftests/ftrace: Choose target function for filter test from samples") > Cc: stable@vger.kernel.org > > Shuah, can you pick this as a fix? > Applied to linux-ksleftest fixes for next rc thanks, -- Shuah