From patchwork Tue Sep 14 13:19:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tzvetomir Stoyanov (VMware)" X-Patchwork-Id: 12493351 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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 2B3AAC433F5 for ; Tue, 14 Sep 2021 13:19:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D250610F9 for ; Tue, 14 Sep 2021 13:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233025AbhINNUm (ORCPT ); Tue, 14 Sep 2021 09:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232762AbhINNUm (ORCPT ); Tue, 14 Sep 2021 09:20:42 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9E63C061574 for ; Tue, 14 Sep 2021 06:19:24 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 192-20020a1c04c9000000b002f7a4ab0a49so1987146wme.0 for ; Tue, 14 Sep 2021 06:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qoekCkBWSeqT6OSBALNKsEEo4Rp8zegVZPY4kN9GsIQ=; b=QOl6X2orW1IJyBgYfiD00rQiyyXX+AiD1sYE0oCj7kjCPQaTP6sAgyJNBUCqN4mOz6 UYZ+2XUMIsV+3Db75DVCMow/KN9xppYDGdPAwLkVZWJmxYqsZueQDvwKhmbfVLXq5pVd dLIgoSN5sdVu9i5/75xiuUF93MPFUjZhRQexT2CgP7uC7Wv1U7kFIpsQCwbOtZ/zlKkA ndpMk+h0WKAXzBii+97/sKhXBmdQ11AYGf7U0CKcnWWE60PVb3mNECF1liP8w8ZfrigZ INd1EstRFBT1HMelRw/GlHdmBQENhMpP/xXZVs0KrzlkXoutLE36ABkpOHumsmko/j7j xvKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qoekCkBWSeqT6OSBALNKsEEo4Rp8zegVZPY4kN9GsIQ=; b=k4Uz09Fk0W49DVh6nNvP4oTMcy4BDBknoc1UCmcfe/MWTeTAhDVuie4sKjFIwvX1IW XAksZJfDqAs3lXthY6EuLrAMI66cUmgue5uyvdjuaEGM7d2gKb9xoJIN8m6b6pVDaahW 3nQ4EkkvRhV6Cp3jjrnd9j1bqcgUWo8NswvkAh/qnFzqRsLUvAD4Cv2d/oTNxt7AKIZN nPW62EgRGgfEsGQZ52q4nCCQnBBPtk4hQ22ERQy0iuPkfqic4Q8+p9ZyR2eHXCUQwsX8 jvTUSGq8uqqvOm/iPe65nhKzbenHLWBZ2i2G6wRjVFVSIbfEN3F9QYGa0wXl2fbcomZd jONw== X-Gm-Message-State: AOAM532PgE+PZYtvSHbMQK9svm3e1Ys4OUARL9KM+keBHRfYwVrcBco7 zCF1bDPAMghZqrw4cEaW2pDwccEkhWc= X-Google-Smtp-Source: ABdhPJxBbKZC46k7qz6bcI5gtUN62ibnWfrybrew+KPSl9sq6dvUFR4bDE6lIIgTJyvIx+dMbmWpeg== X-Received: by 2002:a05:600c:a08:: with SMTP id z8mr2196965wmp.165.1631625563428; Tue, 14 Sep 2021 06:19:23 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id f18sm4545302wrw.63.2021.09.14.06.19.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 06:19:22 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v2 0/8] trace-cmd convert Date: Tue, 14 Sep 2021 16:19:13 +0300 Message-Id: <20210914131921.3967421-1-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org A new trace-cmd subcommand is introduced: trace-cmd convert -i -o The command converts trace file between different versions. There are two parameters for controlling the type of the output file: --file-version < 6 / 7> --compression < none / any / name of the desired compression algorithm > This patch-set depends on "[PATCH v2 00/20] Trace file version 7 - compression", should be applied on top of it: https://lore.kernel.org/linux-trace-devel/20210914131645.3966308-1-tz.stoyanov@gmail.com/ v2 changes: - fixed issues of split and convert commands with some corner cases Tzvetomir Stoyanov (VMware) (8): trace-cmd library: Use output handler when copying data from input file trace-cmd library: Handle version 7 files when copying headers between files trace-cmd library: Copy CPU count between trace files trace-cmd library: New API to copy buffer description between trace files trace-cmd library: New API to copy options between trace files trace-cmd library: New API to copy trace data between trace files trace-cmd library: Extend tracecmd_copy() API trace-cmd: Add new subcommand "convert" .../include/private/trace-cmd-private.h | 15 +- lib/trace-cmd/include/trace-cmd-local.h | 13 + lib/trace-cmd/trace-input.c | 698 +++++++++++++++--- lib/trace-cmd/trace-output.c | 122 ++- lib/trace-cmd/trace-util.c | 8 +- tracecmd/Makefile | 1 + tracecmd/include/trace-local.h | 2 + tracecmd/trace-cmd.c | 1 + tracecmd/trace-convert.c | 106 +++ tracecmd/trace-restore.c | 2 +- tracecmd/trace-split.c | 2 +- tracecmd/trace-usage.c | 13 + 12 files changed, 879 insertions(+), 104 deletions(-) create mode 100644 tracecmd/trace-convert.c