Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1616786pxy; Mon, 2 Aug 2021 06:18:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtbRfcD7pvcBpKMqfohYb+J+hbqzFlNr2NGIGTd1apXyQlcwBjUioanpS7xViAbNSt1wwk X-Received: by 2002:a6b:8b43:: with SMTP id n64mr2587192iod.142.1627910323443; Mon, 02 Aug 2021 06:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627910323; cv=none; d=google.com; s=arc-20160816; b=w+3DtHokU7m1wF91LrjS2y91NGhDPueA/7A6papyeq64Q4QmlC4rF4oedG75uAi6tb 57GFycWw8q5hpqgVfcDo5AXtfhCRFMUjGz7AJUpv6zTLgJoPbLPw2ezjRLdNpr264cLU BciD9bNe/QEom/bPQoP3NWYuX919KRqB/w+JudWXo+4xAy/aF4/CZumOjMVNCdcQjvvd 9D6KuVBqDdSRzqPOdyk6pdVVRwp2gtKX2jvQTwWlklqlnePP7tADCAwZw1gIPOkNohAS 7fphKMFBlraD8jgNW6iBYo1AhAudfXaR02tqcA1RUNaWej8MwWuyBg9rUYicEXuBsqMn Ef4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=epqsQXQY6hsRvvUBNy8FaSC3zfzQt/6QI/2ZJhpL1QE=; b=oYhLrT7uFmDAMlJdEQitGM7tdX8H8fQnRZIQFEEcM0/VU69gCGZvKuIowETlKR9Ep6 xBsMdvS+kpSUoKt1lW1v8RRRYFlpnTL0lE97HxEuRdDJpGCWOKnsN0Ne1hs4YI4gsz15 jsP5fjdK8G0C5WBsdB/JHC/zWC6taWFXQTLgoFrp4JDUekAdMxU/Oiw5SmawXR8IyaIy 5O1DlipkYdGY6Hmm8dy0P7N/FQgJa89VHBa43ifYGgfXpKVz0M4vOwQ1dqxZg2QRzYt7 LH/7JeBzfOVoxOJ+YvCR1WcQIjSF3kQlGtLX2uvlGrSDnmfSmZHve/fyJ+4JpwS8bpvL QYdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l3vUA9I2; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si14544295ild.123.2021.08.02.06.18.29; Mon, 02 Aug 2021 06:18:43 -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=@kernel.org header.s=k20201202 header.b=l3vUA9I2; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233646AbhHBNQm (ORCPT + 99 others); Mon, 2 Aug 2021 09:16:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:37780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233764AbhHBNQj (ORCPT ); Mon, 2 Aug 2021 09:16:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3BE5D60F6D; Mon, 2 Aug 2021 13:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627910190; bh=1Ex0+3uTcYZ6jvFeDk088gY4QbGXw0sF3nCd8f5WDt4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=l3vUA9I2Jv/CJhN9WkDO95RjcFbaoJO8T05X0i4RuuBqzMVBTma4bZgizE7xnF5gA lBcGXFdITRWDjvxecXOkXNnQrFCqPPOhEPVE9jfReArFKChwl7c4r2IFzbeWcra8l2 eiweUhr9vGbbdzq85322CNcaZSg8mSNdaNtdGjjlZHyzx/TJdS1z/9nR0jqLA7wB4G +fELEpfqYXXdPMr2kwGz3dX2v5AOCc1V+0060JqK1aV/5fL7v0+xvuYZBEGIMlkSFf zMWIIw9Mdg7Gj+dpPGCn8HMIKKlRl0wbtqIgU8NVKjg9/Co7BPouCB0OEbx85vEkJs GgsKBi3EVPxzQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 4A0EB403F2; Mon, 2 Aug 2021 10:16:28 -0300 (-03) Date: Mon, 2 Aug 2021 10:16:28 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim , Jiri Olsa Cc: Ingo Molnar , Peter Zijlstra , LKML , Andi Kleen , Ian Rogers , Adrian Hunter Subject: Re: [PATCHSET v3 0/5] perf inject: Fix broken data with mixed input/output Message-ID: References: <20210719223153.1618812-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Jul 20, 2021 at 11:01:43AM +0200, Jiri Olsa escreveu: > On Mon, Jul 19, 2021 at 03:31:48PM -0700, Namhyung Kim wrote: > > The perf inject processes the input data and produces an output with > > injected data according to the given options. During the work, it > > assumes the input and output files have the same format - either a > > regular file or a pipe. This works for the obvious cases, but > > sometimes makes a trouble when input and output have different > > formats (like for debugging). > > * changes in v3 > > - use task-clock:u in the pipe-test.sh > Acked-by: Jiri Olsa Thanks, applied. Had to do some adjustments due to minor conflicts, can you please check tmp.perf/core? - Arnaldo > thanks, > jirka > > > > > * changes in v2 > > - factor out perf_event__synthesize_for_pipe > > - add a shell test for pipe operations > > > > > > For example, this patchset fixed the following cases > > > > 1. input: pipe, output: file > > > > # perf record -a -o - sleep 1 | perf inject -b -o perf-pipe.data > > # perf report -i perf-pipe.data > > > > 2. input: file, output: pipe > > > > # perf record -a -B sleep 1 > > # perf inject -b -i perf.data | perf report -i - > > > > > > Thanks, > > Namhyung > > > > > > Namhyung Kim (5): > > perf tools: Remove repipe argument from perf_session__new() > > perf tools: Pass a fd to perf_file_header__read_pipe() > > perf inject: Fix output from a pipe to a file > > perf inject: Fix output from a file to a pipe > > perf tools: Add pipe_test.sh to verify pipe operations > > > > tools/perf/bench/synthesize.c | 4 +- > > tools/perf/builtin-annotate.c | 2 +- > > tools/perf/builtin-buildid-cache.c | 2 +- > > tools/perf/builtin-buildid-list.c | 2 +- > > tools/perf/builtin-c2c.c | 2 +- > > tools/perf/builtin-diff.c | 4 +- > > tools/perf/builtin-evlist.c | 2 +- > > tools/perf/builtin-inject.c | 38 ++++++++++++++-- > > tools/perf/builtin-kmem.c | 2 +- > > tools/perf/builtin-kvm.c | 4 +- > > tools/perf/builtin-lock.c | 2 +- > > tools/perf/builtin-mem.c | 3 +- > > tools/perf/builtin-record.c | 40 +++-------------- > > tools/perf/builtin-report.c | 2 +- > > tools/perf/builtin-sched.c | 4 +- > > tools/perf/builtin-script.c | 4 +- > > tools/perf/builtin-stat.c | 4 +- > > tools/perf/builtin-timechart.c | 3 +- > > tools/perf/builtin-top.c | 2 +- > > tools/perf/builtin-trace.c | 2 +- > > tools/perf/tests/shell/pipe_test.sh | 69 +++++++++++++++++++++++++++++ > > tools/perf/tests/topology.c | 4 +- > > tools/perf/util/data-convert-bt.c | 2 +- > > tools/perf/util/data-convert-json.c | 2 +- > > tools/perf/util/header.c | 12 ++--- > > tools/perf/util/header.h | 2 +- > > tools/perf/util/session.c | 11 ++--- > > tools/perf/util/session.h | 12 ++++- > > tools/perf/util/synthetic-events.c | 53 +++++++++++++++++++++- > > tools/perf/util/synthetic-events.h | 6 +++ > > 30 files changed, 217 insertions(+), 84 deletions(-) > > create mode 100755 tools/perf/tests/shell/pipe_test.sh > > > > -- > > 2.32.0.402.g57bb445576-goog > > > -- - Arnaldo