From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEC0CC07E95 for ; Tue, 20 Jul 2021 09:07:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC87B61209 for ; Tue, 20 Jul 2021 09:07:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231430AbhGTI0G (ORCPT ); Tue, 20 Jul 2021 04:26:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59730 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235205AbhGTIVP (ORCPT ); Tue, 20 Jul 2021 04:21:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626771708; 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: in-reply-to:in-reply-to:references:references; bh=7R2usiUzQiJENd2iMckw4Ax7g0Vc0lClCVihnaEn6DY=; b=PiaTz4lNHoF27DfA9KnnrfmoVp2Ikx97SlTRZqgC1n+nDW/COVA/BqJkjDbSrVDqy3Wcjq emMpbTqYCuSYY2ES9cNnWAfWkpoiE+UkdK/m36SmGQ6ab1dyKxKkBfck+tPuI+/LvI6IHD 05n20KTeZNjr1mlx5rpndUXqLIDPvDw= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-222-l5aoCdYiMzCAwUfvKNqEUg-1; Tue, 20 Jul 2021 05:01:47 -0400 X-MC-Unique: l5aoCdYiMzCAwUfvKNqEUg-1 Received: by mail-ed1-f72.google.com with SMTP id n10-20020aa7c78a0000b02903b874f26036so367606eds.20 for ; Tue, 20 Jul 2021 02:01:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7R2usiUzQiJENd2iMckw4Ax7g0Vc0lClCVihnaEn6DY=; b=ro5yHDa8MdJMu5N/8dPQGnjFF2A/XzT7RIt3ut1MZ/fLAlIAAA7iohAs8984nulbM5 uq4uhfUBOIzC+SIQ1u4TnfETLvv8bvoOvURmuPWIq81BuPcPW8coIzHxUXnQd0wvvpiA EcGGWefECV9OFO2kfquVKQ02noACeYz5/wYUo4XV+MScKsh3tESnf2VSl9/bFeI3F4oP awGU9Ej4mhqk/x1AYGMy56Z9r0PEfrW5BQKSh3AIp/ruF680YszBRZDHVHnI0VqPZVt4 rqZNUmj3zrryoOGX7tLPytV1+A2CYEHKy87kw/R3wJn70djFFYpcKo/83Ey3hAbgbslx sSkw== X-Gm-Message-State: AOAM531U5mgebahzFUGKzeZKOGuvW3QEpD7tt9OXCbAdUH09xXCzswSv /syLDV0gzLZjHuVTOn6CeD8imhz+Jx2kSdz+YIau/M64R6V6jTjodfq9HfC/GFKmwvP2zZzy06p QTvy3tD4byK+l3KjlHQwpGiuG X-Received: by 2002:a17:906:7a56:: with SMTP id i22mr31005393ejo.94.1626771706354; Tue, 20 Jul 2021 02:01:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzztOrdUoGhBGmV353kblZXZx4DE2SpHtqOsIMbsIEf44ni4kNGTH+p10PiWteAZMz08+NiSg== X-Received: by 2002:a17:906:7a56:: with SMTP id i22mr31005383ejo.94.1626771706183; Tue, 20 Jul 2021 02:01:46 -0700 (PDT) Received: from krava ([83.240.63.206]) by smtp.gmail.com with ESMTPSA id k8sm8968653edr.92.2021.07.20.02.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 02:01:45 -0700 (PDT) Date: Tue, 20 Jul 2021 11:01:43 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , 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: <20210719223153.1618812-1-namhyung@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 03:31:48PM -0700, Namhyung Kim wrote: > Hello, > > 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, 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 >