Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1890970lql; Wed, 13 Mar 2024 11:00:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbv8etNlO5RSXMHOdNGZDO9s0Wqjgk6RarENcu0gBCWyJ0PTVTbkQbCvlW24gD248f9ahlk7GeVIqrynrpo1v8i4pGWn4ssPgWVW7brw== X-Google-Smtp-Source: AGHT+IGM5RTiMPkH0RGq+bhW/sEIc6ATKFJAoO9lLQyLViw4LmKaLhmovhqPxHm+SlaEVrAI1xGj X-Received: by 2002:a17:90a:5798:b0:29b:f9eb:c531 with SMTP id g24-20020a17090a579800b0029bf9ebc531mr9059950pji.21.1710352807277; Wed, 13 Mar 2024 11:00:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710352807; cv=pass; d=google.com; s=arc-20160816; b=oPPXaeuE62AwYBnRgsc/if6l9jP3JrSzq7wYr6gqyp4gNzy56RJrNsIYfwMGGU31zg A9MeZ8ERXsSVVrPx+odXI50V3me3ucYOcQFiCiPeOooAX2+RcBB+PHUmFiKePN0Gdm0m e5gEgpnkxtJydOYjMF3mJ+VktRA+LHCP3lO7fkwkg196S/y1ZXihNXPZfcbmZa4fJQnG fXhDj7cJRyArDIqQWVkFdc0Yfmiou0mxnO8vnYcdr9di5dLqerN66pAR2ppSITmZFA9K OT/Wkuyv62kSItjf7cpMRx8tFSBzQclsPszHFFYjJpufXwYUVdfVKw/8Duz0DVAhdplt QqAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=/u8ZrY8sdFo2g+CmoHjb0TtVHcvA+5O3rJ7eccy6sco=; fh=xYiLw6o8SvpxyOKH5/GyShptOKOXIXtUSJZAqWMKORo=; b=K0a2/hWW7/DcvhIeu0/tWv05pO5jji+JChtajPo3DiH6kOx/7Ayiou0qJqVYX//k4f Z4BqceNaKdfPq34ZUzs/i4A2vPW/QhMXjMYo4kA8ieRcfvukxUlSo/f6ww/MzGNsgTgd uMGX+xO30nP6giJwke+HWVXzdguGq3awz3d/1fvPrWOaQvlI3bg6asIoH4eZ3+Z3xpkG XfZtI68QvHEq2/+hrG0dPE80tDuP4/uIMC0isw4fh8q+NzJk8MVXLLgDG1Ds6CenP+fx hdLrLUFWV2B5XrvAX7wcXrkuut6CU88ehC89vujTIVn6CT1mcrcHSK4snYE62GvGt/51 pedw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=f2SmWq1g; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-102110-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102110-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z10-20020a17090ab10a00b0029b64305505si1800774pjq.106.2024.03.13.11.00.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 11:00:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102110-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=f2SmWq1g; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-102110-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102110-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 21F2F284281 for ; Wed, 13 Mar 2024 18:00:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EC265FB8D; Wed, 13 Mar 2024 16:53:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f2SmWq1g" Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 E674A5F541; Wed, 13 Mar 2024 16:53:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348792; cv=none; b=P/FnVOQTz6D03c5s37f7HxqX0hyhh3+Qfbwmm88IhqCnLNpzO6ge3rRgwRjLmPqh4wSh2JDNje1IvoeWZzh/ESLrKHRpsY8GSfJThdCbN7xZepJlt7sfJRJIISSy60WFHX5IWWOtrOjOwVTh52FttHxaPrQypWv676wK7/B9Kl8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348792; c=relaxed/simple; bh=xCzpgaA+HTbALS3/kwZcZ+auovGGgbqRsKa38fzJmHI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=FYyziY+f4Czq2eDiX+rBM9o8IoVIVui4SwjsPDIY5tCf5B2dy6K+8KDHJuaGTX9su0PZ4387xaKKpyCr9AnRzSJcvdXEhNYj7tl5GxxKROubYTUJO+QBcCyqu+OVTyBpPKH11QYGSd7J24vM5uzZ0Z/FfxjYP78D533BeeULh5U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=f2SmWq1g; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-29bbff1505dso103129a91.0; Wed, 13 Mar 2024 09:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710348789; x=1710953589; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/u8ZrY8sdFo2g+CmoHjb0TtVHcvA+5O3rJ7eccy6sco=; b=f2SmWq1gAhW3BbvQQgboyimm+ZMdmYja/LyNaR85Ff/koVW57VgPhehnbLBk6CBHjT 6TacvkWrj8w6g719vbnzvvN0UIae3JqigehFM+ZBgyH6hEq0+o0eqUXcjH8Nf31cP/vz XipVLr/AuKcm/dB31jQMlverAw+AUIRTN5frs37Hro/EurIuAlY/KAQfMz+ospO6s8Ug Yqoz0sEqX457qL5C7NafgvnxQ0LYT6RZY4qczJyR1Kevp77BtLZt/56dOy30wwCKX881 nZgFSjjO7kPg6vS4rtTpUIrQLzdSNm1bZxQT3hzi7kXeTRPRLCJ2j1C6kOGetfwcYFam xf4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710348789; x=1710953589; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/u8ZrY8sdFo2g+CmoHjb0TtVHcvA+5O3rJ7eccy6sco=; b=JfI5K+M/4xj+IOs+JhEtxgEpgRBRd4vOsVrvUWvMmVg/WDE9MjDi/1UR8y0lSfC7dR Q+zS6lZ0A0uvyMnLKyxvBVtVbLzRWxFWuyroDM0+zKi8ARFqLxictjBPfGumlO1mO0Vx HdspDIEneXwbVLd2GsR8Qj3raDbeQp3kCgz4JvbdrHEG/VGZBXUw7mSp5Adzv27rBNd9 XWfL8rAkzEYS+d3YPvtEHnaQKMcanwcVj9f/Fmb5gRQR7MClB+iCg97v8R0dAUm7aHRH Ad1cP43W9UPt6yyL1MQEoIT3zuMnWZgwQP+E7e8v4Bmr8tZVXQX29fLWHnOuw41jpsYj F5ag== X-Forwarded-Encrypted: i=1; AJvYcCX7b59aSF4ADjWzvgz2/m1Y/zDYQ7XAPGL2xWK1xGImjuP4Ytp1Ac1LZsRYEfYkLC42mMERYxW9tv28lYYQJLfoLDVQmbtSNl0u2TICJ3FQQHA7Xy+xtb1M9LyPMsVKRtNwTiGOgOv50nalMdWhZ4Bt5aai/epT9Hce4y9uN0gMwR+aZKzg X-Gm-Message-State: AOJu0YxPmISrHVHEgv9yPEH1y02NgXqHIS/5BMwhVMhxkOSUf9eUCE86 I53lC7vzdsXi2hXU2nPe+iULtK3JugJs7PDKn3vUut+u1wIkCcRfQ4JieVztB3Ftp0a2H8HYl4+ ecxTkYWinKq2uY9FopbXWV7djQIhtr6Ss X-Received: by 2002:a17:90a:a407:b0:29b:ab0e:4f03 with SMTP id y7-20020a17090aa40700b0029bab0e4f03mr10231243pjp.37.1710348789075; Wed, 13 Mar 2024 09:53:09 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240312210233.1941599-1-andrii@kernel.org> <20240312210233.1941599-2-andrii@kernel.org> <20240313151507.GA25452@redhat.com> In-Reply-To: <20240313151507.GA25452@redhat.com> From: Andrii Nakryiko Date: Wed, 13 Mar 2024 09:52:56 -0700 Message-ID: Subject: Re: [PATCH bpf-next 1/3] uprobes: encapsulate preparation of uprobe args buffer To: Oleg Nesterov Cc: Andrii Nakryiko , linux-trace-kernel@vger.kernel.org, rostedt@goodmis.org, mhiramat@kernel.org, bpf@vger.kernel.org, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 13, 2024 at 8:16=E2=80=AFAM Oleg Nesterov wro= te: > > LGTM, one nit below. > > On 03/12, Andrii Nakryiko wrote: > > > > +static struct uprobe_cpu_buffer *prepare_uprobe_buffer(struct trace_up= robe *tu, > > + struct pt_regs *re= gs) > > +{ > > + struct uprobe_cpu_buffer *ucb; > > + int dsize, esize; > > + > > + esize =3D SIZEOF_TRACE_ENTRY(is_ret_probe(tu)); > > + dsize =3D __get_data_size(&tu->tp, regs); > > + > > + ucb =3D uprobe_buffer_get(); > > + ucb->dsize =3D dsize; > > + > > + store_trace_args(ucb->buf, &tu->tp, regs, esize, dsize); > > + > > + return ucb; > > +} > > OK, but note that every user of ->dsize adds tp.size. So I think you can > simplify this code a bit more if you change prepare_uprobe_buffer() to do > > ucb->dsize =3D tu->tp.size + dsize; > > and update the users. > makes sense, done > Oleg. >