Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp74927rdh; Tue, 6 Feb 2024 20:16:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVy7YnbTL+p1G+zzP3DOMz9Afrd1ZNVMXSZ056WyWbfPKK90B6mtRQ9BP5PYk0AcThQm8AIHTy91pqddj7Z677QCrSnbBX/Ny/PDbsMxg== X-Google-Smtp-Source: AGHT+IGOBK9KryqAifBxzPTpro4c/HqSKuae+DJ0+Y9gk9COPCmt1sHFYhtpDKA0RVqB4k4Mi1yp X-Received: by 2002:a17:903:2304:b0:1d9:650a:92e3 with SMTP id d4-20020a170903230400b001d9650a92e3mr4596415plh.22.1707279376347; Tue, 06 Feb 2024 20:16:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707279376; cv=pass; d=google.com; s=arc-20160816; b=U1nYA7rtqQD/Xk/WSZpTEeh7sqQJteUawXiaGf8wtkqz0X10fjfgxTVIuHGUujZSeW JFjqzYqQVM7rAX8qOrrMVmF1NfLpXpU58a94j4XfihutNnoYxDZ8jm7w6sMiXdEWvYw/ 9Ev3joKa4ZL8A8JdKmQ/GBr/7DMMbZwWjpPXUU369LycmXifoS2jSnyfTQXtz7/MtW+n R+jZtHQCrXklo4QvygvNdtgHMzxqdmYtzDXLzISvr8K6sTjYSG2lHHjd1c+VlUeBsudR kGoeFrV4cA/zhVm50aCv0RZZ4YlpzqWWcywiJUs2foc7kXqHL0rHAYk8HY9L7Hxq0p5F 0y0A== 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=PHLcblWjU6UgGzJLYm+rTZl/ZAIvc9e3m6tFVYB02E0=; fh=iE8d4TeaPJh+BuBjUPdtODoX/7m1fSoSrezvoi0KwgU=; b=ulyyF150r5PgrZKeR47jLTS76A6MBaKpCh1tQXttAqoLf+XbJEcrK48b3OKvT7tMbF 6oymVze3oa3KvUDKAaMutj8LuMF5Pxye51vusJY9zdtkmiJDNNL60nAxlPF13SpR1r0Q T97dfjsYZvUt77Zw3Fo7yVEabahHGjtflH+ZtOjQi733BYQV92SUf/9DMg660eOXJezf b15PF3rvUXbByIqDuQ9JpT+PoZ4X+0PHloyXhSsCB8c61nyUvvQti7xHDspm/iiR2eVE cEufTIICVA94lUFJMf1GB6uVsq0GMgc9PNRJeq3LZ6zY62UJeSZuPL8iJMO4W/TRvtqR ntfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=jozsAp0A; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-55922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCWS2gba8RlqPebQY2IFzrjxSMW96I+QfZZd1PmrJYkMNF9+QU0SjaCoCf2aS5+Bo3i1Z5vn+eQL39ms4D3/92qjmRLJPJlSHtJnCMtnTA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d20-20020a170903209400b001d9b6a12003si592363plc.432.2024.02.06.20.16.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 20:16:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=jozsAp0A; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-55922-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55922-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 322F3B28F66 for ; Wed, 7 Feb 2024 04:14:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 805CA111A5; Wed, 7 Feb 2024 04:13:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jozsAp0A" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 482C215491 for ; Wed, 7 Feb 2024 04:13:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707279226; cv=none; b=r0sVopXeHvneTNOGJY5VqZFhirHMtYxMvFwl1NUYsK5faaD4uD87g5HaLaDdEIE+Z1ZnYd1lp0HIQ/2xIUAX/WEDMtnuCNpIfe3l8B2C58WOtERPQBJc4/uyRUfXEj+Sgw9CzHS7XVwid11d4nincSIn1jH7yoQcdRonNZtnSVA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707279226; c=relaxed/simple; bh=DawtPmRgk6yjmGv8Et+8qRTVs6tdkKeMMQQpJIvE9NA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=K89/dAxACiL+sbzq91rQl11NNzm6FCEVjNtBb5GPK+u1JiNipDi8NxTm4sZnlfM2U/P4KRB1WYLjcto3TQNt3KWs3rMUixqm3Jt1nHediagBOpnLDvpjSsmaqvwZ9FPpW0mfXc981Kp2Iw4yCuiXiTyJub70JhqIlg6iC13wiBY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jozsAp0A; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d93b982761so35765ad.0 for ; Tue, 06 Feb 2024 20:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707279224; x=1707884024; 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=PHLcblWjU6UgGzJLYm+rTZl/ZAIvc9e3m6tFVYB02E0=; b=jozsAp0AWY8j5F1ybvtQxukfY9/t4sJ9lUUHfnJUdl3rOaAN+oqPWVw36SWVM2ZADe U+AyTUvuVMhKckhCwXrh23kh/cgOFhQbUNCb0hlwtrEZYxdo63QwRz7hZ5RmS3oj8DSd prc10qxhgXndxVBSsqFpZm/yX/ES8r6zccTHPeWcS41xWcRCzsaHngW6S8fVHVD9zLub OEyxDothn54rg84r+f3Ucs1HL5vZtOuza7yYHW1kRGAbvLOeqj4mkGtoRfGDgFnEfkuC 5DVLIkw8AdGimCZtX1Irq0J49EfMxsE1Am5F0Hn5PjYMYLAYSnShq+rYTTx4jeXgxeMM U19A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707279224; x=1707884024; 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=PHLcblWjU6UgGzJLYm+rTZl/ZAIvc9e3m6tFVYB02E0=; b=acDserZA7EjIMKY/KD7RxOdVUhNLCz4HCE4jtGuvofTJ74418Ed4GKpUrAxDH/sr3a +sUDUY24OwKMRCp5EBTtA6cDjMZ0z0+KlIKAQhlFTW9X3eIdiEev1cEdqlczHOfw4Qve WvWmvU232KDgfOFXh0Q6V1vUjvA9Fm7s/j4HWv1Ok0pn7MPMrVLTxcDBaaQLWqJ12BXH faZD8PYzuUAtBhRNRlyj0K4T7vFc9l1ChJgw+yDukTG2xgAuMEBs/Ygds46sSEsLtcQA RWW8dublMI1au11ioYeIEhErxEwmx0OCdsC5viS652NvR2nYAXsywm7JmsyUosb2ej7+ Pkzw== X-Forwarded-Encrypted: i=1; AJvYcCUhVNrAK7UwpFBABM4DNakZql+Fcbsv/PPK6uH+tgzpcrxIraD+f+49hoXuMQj9Ckp+0E2G74lxleIzD7woGTlrBLaP/DpwbAmy672D X-Gm-Message-State: AOJu0Yy76plyfoRdFmQ9nZ/dIlAPFOA1r+ajORod7SAmKD/uulUsfkno s64DL5wfELTyY/F4j7pDjd+N5qnHqacBqKJfN1gYfHWnWMey78m5XPR0BxivDo5k2mOrqj/A/L9 35uRe64okKQ0etHp55aZbE/ngdnCGM2xsioDC X-Received: by 2002:a17:902:ec8a:b0:1d8:d90d:c9ae with SMTP id x10-20020a170902ec8a00b001d8d90dc9aemr15347plg.1.1707279224349; Tue, 06 Feb 2024 20:13:44 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240112231340.779469-1-namhyung@kernel.org> In-Reply-To: <20240112231340.779469-1-namhyung@kernel.org> From: Ian Rogers Date: Tue, 6 Feb 2024 20:13:32 -0800 Message-ID: Subject: Re: [PATCH] perf record: Display data size on pipe mode To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 12, 2024 at 3:13=E2=80=AFPM Namhyung Kim = wrote: > > Currently pipe mode doesn't set the file size and it results in a > misleading message of 0 data size at the end. Although it might miss > some accounting for pipe header or more, just displaying the data size > would reduce the possible confusion. > > Before: > $ perf record -o- perf test -w noploop | perf report -i- -q --percent-l= imit=3D1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.000 MB - ] <=3D=3D=3D=3D=3D=3D = (here) > 99.58% perf perf [.] noploop > > After: > $ perf record -o- perf test -w noploop | perf report -i- -q --percent-l= imit=3D1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.229 MB - ] > 99.46% perf perf [.] noploop > > Signed-off-by: Namhyung Kim Reviewed-by: Ian Rogers Thanks, Ian > --- > tools/perf/builtin-record.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index 91e6828c38cc..21ebcb04f1d8 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -1773,8 +1773,11 @@ record__finish_output(struct record *rec) > struct perf_data *data =3D &rec->data; > int fd =3D perf_data__fd(data); > > - if (data->is_pipe) > + if (data->is_pipe) { > + /* Just to display approx. size */ > + data->file.size =3D rec->bytes_written; > return; > + } > > rec->session->header.data_size +=3D rec->bytes_written; > data->file.size =3D lseek(perf_data__fd(data), 0, SEEK_CUR); > -- > 2.43.0.275.g3460e3d667-goog >