From patchwork Wed Mar 24 13:04: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: 12161125 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,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 B4946C433EA for ; Wed, 24 Mar 2021 13:05:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 95B6861A1D for ; Wed, 24 Mar 2021 13:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234474AbhCXNFd (ORCPT ); Wed, 24 Mar 2021 09:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234500AbhCXNEr (ORCPT ); Wed, 24 Mar 2021 09:04:47 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFA0EC061763 for ; Wed, 24 Mar 2021 06:04:46 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id v11so24357867wro.7 for ; Wed, 24 Mar 2021 06:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JV7AAIqGr1HS87/CTo6xLRmr6EAxMQRsqqk5ekMFjWs=; b=fIBZ+gsa0LWtFR1mzkPfq54wBOehzwwg8/OBepxPeXD5GXQjscA2RMpRrefSLEKTcd vXp6I4i5p5fzpCjE1pVB9CDjm6e0ptXcg6YCmpKxvyAI7AqX8/wm3wZuPxqqIgwxpT1M EkRMDqOCcLA422d8Kcbcu/F8Tsi+64sD37v1v+xqMDk7iwfkq1OmR+X3UMl3BexqsZzf 7dooEsb5biHvyM6/F+ph2BqBpzJgnM1G0leiAlANd62xV5r6jda883tcAIDU2Av+a+vx WZgTSHOpC4c6tG26dbYfBf3t0H11TEOOkM6rteF4O7W8gQFfDZysNHM4m9eW/DlWn2BB dHpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JV7AAIqGr1HS87/CTo6xLRmr6EAxMQRsqqk5ekMFjWs=; b=JuT6yn1GdgbSqVa5zgxYK6iItLmcLYshiOOF0kuLAjgNTUswsfb/PQN9MYYep6AQb+ uvQqpGnmdQuiyfrOv5NSQW1dZrnUbiVDBNLikw6ie/UTE3igNEyO/vmrjLJYo4OZR/v7 6oiimQJabC/uupGXxlNeOuu47Hqzcat2lMMS2L1eeRqB7YWrfjxSTW51e8GsUQUaxymC iPjwWK+SMm0GXNCaN9J6hNIX3RP1Yf5YD/thaapS63DDYFDF4iBXVA6CNLo+Ep6ffebA 2knZ4yfFLuKRUZQKr6Ro5okDvNymVxP90+GcfHgaa7lIcXcAGvO4VsPDLFKa0C6cyDmA LTmQ== X-Gm-Message-State: AOAM530qY+Z/MtUrId68LjGKf2W2ntV6kOiuAe1XaqxvL6Oy6Qkc4ZkN 92FbwZUeoSlb141hbk6+eOK3WalRpuoXZA== X-Google-Smtp-Source: ABdhPJwPqMIcybxaLhZQWmrnN2G4r21M4C83cZM/CHqU/HnCrZCRCEmz6BDhV1d6cSMyLtzzcAZuIQ== X-Received: by 2002:adf:c587:: with SMTP id m7mr3331250wrg.369.1616591085713; Wed, 24 Mar 2021 06:04:45 -0700 (PDT) Received: from oberon.zico.biz ([83.222.187.186]) by smtp.gmail.com with ESMTPSA id w11sm3034919wrv.88.2021.03.24.06.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 06:04:45 -0700 (PDT) From: "Tzvetomir Stoyanov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH v3 18/23] trace-cmd: Add new parameter "--raw-ts" to "trace-cmd report" command Date: Wed, 24 Mar 2021 15:04:13 +0200 Message-Id: <20210324130418.436206-19-tz.stoyanov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210324130418.436206-1-tz.stoyanov@gmail.com> References: <20210324130418.436206-1-tz.stoyanov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org "trace-cmd report --raw-ts" disables all corrections of event timestamps from the trace file. Signed-off-by: Tzvetomir Stoyanov (VMware) --- lib/trace-cmd/trace-input.c | 4 ++++ tracecmd/trace-read.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c index 9b4f8cca..0f5ed684 100644 --- a/lib/trace-cmd/trace-input.c +++ b/lib/trace-cmd/trace-input.c @@ -2932,6 +2932,10 @@ static void extract_trace_clock(struct tracecmd_input *handle, char *line) if (!clock) return; + /* Clear usecs if raw timestamps are requested */ + if (handle->flags & TRACECMD_FL_RAW_TS) + handle->flags &= ~TRACECMD_FL_IN_USECS; + /* Clear usecs if not one of the specified clocks */ if (strcmp(clock, "local") && strcmp(clock, "global") && strcmp(clock, "uptime") && strcmp(clock, "perf") && diff --git a/tracecmd/trace-read.c b/tracecmd/trace-read.c index 22e8635c..1b99db1d 100644 --- a/tracecmd/trace-read.c +++ b/tracecmd/trace-read.c @@ -1484,6 +1484,7 @@ static void add_hook(const char *arg) } enum { + OPT_raw_ts = 236, OPT_version = 237, OPT_tscheck = 238, OPT_tsdiff = 239, @@ -1533,6 +1534,7 @@ void trace_report (int argc, char **argv) int print_events = 0; int nanosec = 0; int no_date = 0; + int raw_ts = 0; int global = 0; int neg = 0; int ret = 0; @@ -1574,6 +1576,7 @@ void trace_report (int argc, char **argv) {"ts2secs", required_argument, NULL, OPT_ts2secs}, {"ts-diff", no_argument, NULL, OPT_tsdiff}, {"ts-check", no_argument, NULL, OPT_tscheck}, + {"raw-ts", no_argument, NULL, OPT_raw_ts}, {"help", no_argument, NULL, '?'}, {NULL, 0, NULL, 0} }; @@ -1746,6 +1749,9 @@ void trace_report (int argc, char **argv) case OPT_tscheck: tscheck = 1; break; + case OPT_raw_ts: + raw_ts = 1; + break; default: usage(argv); } @@ -1777,7 +1783,8 @@ void trace_report (int argc, char **argv) if (no_date) tracecmd_set_flag(handle, TRACECMD_FL_IGNORE_DATE); - + if (raw_ts) + tracecmd_set_flag(handle, TRACECMD_FL_RAW_TS); page_size = tracecmd_page_size(handle); if (show_page_size) {