From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 609D93DD537 for ; Thu, 25 Jun 2026 12:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782389138; cv=none; b=AHQwFQCPwD0JBXFYNaBj+Qc84zeFv2fM9qF6Aj1iMhRKnfCAvjL2PAe26dehMQmrQ/aNePdj3Lsr5uJsMBvIYVMJZ7GlYwm/Rv0u0yc+Cjpo4KNBc0YWp0NQut/25VOjWxSC2TXP6wNRJJayRi1OZwvpwTvigJfK+EerekqQ4ZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782389138; c=relaxed/simple; bh=1XNAuaLY5p2QwZ1xZOVagV8DDqx/t5x6UyDOQ78JEtc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=svscDzin2E9nUmZ9FEn8BmEUZ6pmxNqAESL9n1XEUAF/ehssEuAVlbMOfpYvkbE8Do9h6p8djvkuupQB0wF7L5av1RI5LHTAdGJ8cW2Sn0z/hVKB4MS1jWMbjnii020hwoxUEPta920wPBZ7PrPqZb0YUuYdtXyTkWtopzZdEMo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cBjbeiug; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=jYIp5s1a; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cBjbeiug"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="jYIp5s1a" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782389136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S5dk0+y7YIP6iBUeL3aPYTXXsaNDLnD9g/Qpkl8DKV8=; b=cBjbeiugDd8erRbsoRYgKShzE3DGElEzXVFEWGK3TKpxhUf02seZcQCmO63WhHcCHZKWfp pNgx1MqANwPjyp5pA+PPqxBfJhkf4iZuHnSMa5An4PfGvm1LDWG3+V0ObyWT+R4xa6maEZ RQSwoxQm7aK2K/Exq5kfUYjPZl+jXSg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-464-6xTxCUQHP02vyX2gKrblTQ-1; Thu, 25 Jun 2026 08:05:35 -0400 X-MC-Unique: 6xTxCUQHP02vyX2gKrblTQ-1 X-Mimecast-MFC-AGG-ID: 6xTxCUQHP02vyX2gKrblTQ_1782389134 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4924d5231daso18088935e9.0 for ; Thu, 25 Jun 2026 05:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1782389134; x=1782993934; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=S5dk0+y7YIP6iBUeL3aPYTXXsaNDLnD9g/Qpkl8DKV8=; b=jYIp5s1asOJJ5vUo7Meax3KhXOaYD6u6UV7L4zTSbe1A9F3S+zvw8jqFgNYQsSkBVV olbIYL5kb9APxD3JWELB7yYBjjuBlIwI/uBjmita7AshgAUg1Lap1QorPGz7kqquVmDU qqTG8B39sQSwmJpcUnPeOfmhovWg75PgFsoinhXwhtRrNeEQ4OZ839c2COPHw1V+KxGP sAJ8KYzhVe6RGcxdTUIhXc7JLwdYvPtmqbv2G+RGyBctUc5rz5PmJMJmzkD1Q6SKZFMm qG2FwjSkM9nKUbYZ1Ei6mFwOOz4K8LbTZ8AZJ9iwi6EGlK68agafIjcV98TcMTUDYUly h+jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782389134; x=1782993934; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=S5dk0+y7YIP6iBUeL3aPYTXXsaNDLnD9g/Qpkl8DKV8=; b=hCtE18ysfnz7ix6WflqhsGCSmvaPGU2W/xnoRSEViXOiM2If+NtXcSqFKiwm1YX2xv mGjvkKsbJ+STyoyr+WUUdlYLO5CNBoU7K57O2h22xjuUND5UulC4+tMiY3XOy/V3M3xI TXNYVCEt4WNmteJF1hHa7i83EacPXW7uOE+GdQxAqx4B1+iAtfa9r+w5K93DrqVmWmVV GEYwzbZnB1PF+IM6lzlUipXyujfE0rwYGqQHYelcDBVCluBrzDnMAp213jN+PQs/SzwO r7XDbzECQ3o/ZxerioXwR1O0mjJLf/vALvYPxam6bnKKQlhR1vAIzpZc7z4kEv8QsVQs klBA== X-Forwarded-Encrypted: i=1; AFNElJ9EhBOYsGKoPS0oC/1qQH0jKq/j8cMpsT/hVLftVvRUIBsBH5HhMBsjA39xmjxoMNeJ6P4Ezj00xYKaw+E=@vger.kernel.org X-Gm-Message-State: AOJu0YwiRIWYVzqapHDXmHal2HUUjZMOxIVRjUdzi0QaXQEn8/HA9Jit enXB633WPXiSPDrC9OQW0nkAhC5vZTCzDyWpWveKFfeOPTYj89qcO2BRU+UCdrUyX4/3omWUgV/ XvCIVpAmKFkR0a/xK7xhNCEnIarPdzGAI7g+gG41uRMtnczT6GKXdY9TSfCsG7iEQ X-Gm-Gg: AfdE7cloLNGegy1OB9PyZcZuIbnkC7y77nbvFpMWAJfmmTU7FjBaL/emUDfE9Swr2cl y/W8n1F0TCREuV2lQrWMEXx7FnsZdpwSLfg7o2JHHBgf2+vm86m3LVH95G7qg0D7AESLuMS3hdk dotE1jrU/Hbzd7XKhhqK9CtfaDGbQskiRGZengIkiy7gbSiz5xvigEVlR4fH1Us6vLmWUAidTfb vLbikGAgXOPlQn5SS5CoDhzPidagUgjM/plQaDPjpa1fakLB1NsNYLgUeExnbzInGEJcwwZyunV rR8oatc6g8vnWOAWkvGVUMkqA/aDTs2vdUM+rRC+1jqBUWkTbO4VjyywA4lbjn2ywObZckB2zmw = X-Received: by 2002:a05:600d:844f:10b0:490:ae52:499c with SMTP id 5b1f17b1804b1-49266899ff0mr23855135e9.21.1782389133737; Thu, 25 Jun 2026 05:05:33 -0700 (PDT) X-Received: by 2002:a05:600d:844f:10b0:490:ae52:499c with SMTP id 5b1f17b1804b1-49266899ff0mr23854805e9.21.1782389133345; Thu, 25 Jun 2026 05:05:33 -0700 (PDT) Received: from [10.43.17.131] ([213.175.37.14]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-46e3d6ba143sm1630033f8f.33.2026.06.25.05.05.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jun 2026 05:05:32 -0700 (PDT) Message-ID: <3c221e35-d642-4036-88fd-d25df7f8807e@redhat.com> Date: Thu, 25 Jun 2026 14:05:29 +0200 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] perf trace: Refactor augmented_raw_syscalls using bpf_loop To: Namhyung Kim Cc: Alexei Starovoitov , linux-perf-users@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Howard Chu , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Michael Petlan , stable@vger.kernel.org References: <20260623112533.1151502-1-vmalik@redhat.com> From: Viktor Malik Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/24/26 21:24, Namhyung Kim wrote: > On Wed, Jun 24, 2026 at 08:47:38AM +0200, Viktor Malik wrote: >> On 6/23/26 19:10, Namhyung Kim wrote: >>> Hello, >>> >>> On Tue, Jun 23, 2026 at 08:27:39AM -0700, Alexei Starovoitov wrote: >>>> On Tue Jun 23, 2026 at 4:25 AM PDT, Viktor Malik wrote: > [SNIP] >>>>> + struct args_loop_ctx loop_ctx = { >>>>> + .args = args, >>>>> + .beauty_map = beauty_map, >>>>> + .payload_offset = payload_offset, >>>>> + .value_size = value_size, >>>>> + .output = &output, >>>>> + .do_output = &do_output >>>>> + }; >>>>> + iters = bpf_loop(6, process_arg_cb, &loop_ctx, 0); >>>> >>>> bpf_loop() is old and generally not recommended. >>>> Please use bpf_for() then the diff will be one line change and >>>> can scale to any number of args. Not just 6. >> >> Thanks Alexei, I didn't know about this preference. >> >>> One thing we should take care is to support old kernels. The oldest >>> LTS kernel in the kernel.org is 5.10 and bpf_loop() was introduced in >>> 5.17 and bpf_for (bpf_iter_num) was 6.4. >> >> The problematic loop was introduced in 6.12 by a68fd6a6cdd3 ("perf >> trace: Collect augmented data using BPF") so we should be good using >> bpf_for. Or is perf from 7.2 supposed to work on 5.10 LTS kernels? > > Yep, we'd like to support old kernels. How much strict are you on this requirement? IMHO, the very least we need to fix the verifier issue is bpf_loop, so that would still not work on 5.10 and 5.15 LTS kernels. We could probably keep the open-coded loop in case bpf_loop is not available but `perf trace` would still fail on kernels without bpf_loop for new perf built with Clang>=22. Also, the code would be a bit ugly and I'm not sure how well the feature check for helpers (bpf_loop) works on old kernels. Viktor