From patchwork Fri May 14 12:18:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12257671 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 19FBAC43460 for ; Fri, 14 May 2021 12:18:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0C896145B for ; Fri, 14 May 2021 12:18:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232969AbhENMTz (ORCPT ); Fri, 14 May 2021 08:19:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232478AbhENMTx (ORCPT ); Fri, 14 May 2021 08:19:53 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E56C6C06174A for ; Fri, 14 May 2021 05:18:39 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id s6so34405983edu.10 for ; Fri, 14 May 2021 05:18:39 -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=KztrVVn3EIMYdDMvJzGCzItRMyVQFSqBgkxfy+ofgeU=; b=i2diZGQhgx214wiAS2gBna9GzO8pIwWPaZ6SmEAFsU4A3825edqDuJVxD1Ny9hl230 QvS77x7iUBEab8apJ//IXZd9gz2kpmE9tZMWSg4G/RpAfn71FHobpIGZyZDooACRQFgX uVFl7u7mVQzDZBealxxi/qVacxPxtSd+ww611E8puDqXaaEY3d4bmQYgpnmti9CZIgQy cJ2Yk1l40CIYqh8S+Rxgk0k5G1dJkWmMz02CXIbSGD5XH5TKfvaF2+FdIxXgIGQ8MyMi paPBSl1VA3kRArmFTvW4XM3kp4N52rLMNC4aApqxRfZPe8Z7P4XTUdB87HnuGOnPZ6oE 7MIA== 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=KztrVVn3EIMYdDMvJzGCzItRMyVQFSqBgkxfy+ofgeU=; b=DxlTeHVscndnwZ4DjNI6wYOIwmGhmij9RfG3abWtc4iKWdHGxMJ4n3uQRYIjQgqvAd hJjNQRuO/MLnGPbZtmfx7lMZIeF1SmiowDVf8yhEil0mTb8Mhs6YmADKl3QW7Wwh7KEp Apaj4oJvIoAQ9d61fXnrh1FNQO0th+svTsQTtVMvxB1SXOcBkFKLwTWK6sJwogitWvOE wgDZOz81p3gAWn3qoLWjHqF1BB3NYnHO9sVs9JyKkQSfycnZi1W3Dr6ikU1G8DNECPLM JAIzJTCIIWUUzmIRMUcqoQjweN2d+ao6VA+Ny2y0NcWy22CpFzXCHQwBLH/sYre29CSN rurg== X-Gm-Message-State: AOAM532Q4gPR1l/MEtrt8drSc+pLUM3ck2lpeKEJNLERqpCXhSCdkeol 84HfNsUr/PeIwpC7CJjEfVn++LqgseA= X-Google-Smtp-Source: ABdhPJxLfkDO4iCiuUeswZwtunGkBt8+tw1TG/F4iu5B5T8B7OmBKBW9HA2yhyQKEDTUnbsvokDlYw== X-Received: by 2002:aa7:c7cc:: with SMTP id o12mr56942124eds.291.1620994718359; Fri, 14 May 2021 05:18:38 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id cr21sm3435157ejc.2.2021.05.14.05.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 05:18:37 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 1/7] kernel-shark: Preserve markers when appending data Date: Fri, 14 May 2021 15:18:20 +0300 Message-Id: <20210514121826.161749-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514121826.161749-1-y.karadz@gmail.com> References: <20210514121826.161749-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org When an entry is selected in the KernelShark GUI (using marker A and marker B) we only keep track the index of this entry inside the array of entries loaded at the moment of selecting. However, then a data file is appended, the new entries are merged to this array and the array is sorted. As a result the index of the marker can/will point to completely different entry. Signed-off-by: Yordan Karadzhov (VMware) --- src/KsDualMarker.hpp | 6 ++++++ src/KsMainWindow.cpp | 24 ++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/KsDualMarker.hpp b/src/KsDualMarker.hpp index 0dcaf93..39c0ce2 100644 --- a/src/KsDualMarker.hpp +++ b/src/KsDualMarker.hpp @@ -154,6 +154,12 @@ public: void updateLabels(); + /** Get the index inside the data array marker A points to. */ + ssize_t markerAPos() {return markerA()._isSet ? markerA()._pos : -1;} + + /** Get the index inside the data array marker B points to. */ + ssize_t markerBPos() {return markerB()._isSet ? markerB()._pos : -1;} + signals: /** * This signal is emitted when the Table View has to switch the color diff --git a/src/KsMainWindow.cpp b/src/KsMainWindow.cpp index d0a434a..fa893ce 100644 --- a/src/KsMainWindow.cpp +++ b/src/KsMainWindow.cpp @@ -571,8 +571,15 @@ void KsMainWindow::markEntry(ssize_t row, DualMarkerState st) /** Select given kshark_entry with a given maker. */ void KsMainWindow::markEntry(const kshark_entry *e, DualMarkerState st) { - ssize_t row = kshark_find_entry_by_time(e->ts, _data.rows(), - 0, _data.size() - 1); + ssize_t row; + + if (!e) { + _mState.getMarker(st).reset(); + return; + } + + row = kshark_find_entry_by_time(e->ts, _data.rows(), + 0, _data.size() - 1); markEntry(row, st); } @@ -1341,7 +1348,20 @@ void KsMainWindow::loadDataFile(const QString& fileName) /** Append trace data for file. */ void KsMainWindow::appendDataFile(const QString& fileName) { + kshark_entry *eMarkA(nullptr), *eMarkB(nullptr); + int rowA = _mState.markerAPos(); + int rowB = _mState.markerBPos(); + + if (rowA >= 0) + eMarkA = _data.rows()[rowA]; + + if (rowB >= 0) + eMarkB = _data.rows()[rowB]; + _load(fileName, true); + + markEntry(eMarkA, DualMarkerState::A); + markEntry(eMarkB, DualMarkerState::B); } void KsMainWindow::_error(const QString &mesg, From patchwork Fri May 14 12:18:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12257673 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 60DD3C43461 for ; Fri, 14 May 2021 12:18:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41EB86145B for ; Fri, 14 May 2021 12:18:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233028AbhENMT4 (ORCPT ); Fri, 14 May 2021 08:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232671AbhENMTx (ORCPT ); Fri, 14 May 2021 08:19:53 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 907CCC061574 for ; Fri, 14 May 2021 05:18:40 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id di13so34474175edb.2 for ; Fri, 14 May 2021 05:18:40 -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=TTG39X9zxsef8MpXaTofsFoEUYLaTQ03yVrBJYfMqm4=; b=Gt3rul8FLp6GP6hsgpa4jFglKegqMCIsat1XhXDLjS+H7F5uupLHQ1pCKaGMFFSdB8 AZGz9UyaGWgm2I5Q8W9fiT9YWuIWvtsU9jIO6H7qr2CLacG5U0wY+T/yIXY9bZljx0Qf +PJ3rp1PvkOIsUQ3QngcCAWm2e7QRDvTsLnRqubrG/i2Fz2/8lNf/1XOxPGdtSK+Vhzu 9e/Tn0SgheyMne9ZNW4T7PlY6wxalmc7JleIv749RPqFlWfz8ndyomzZ5JqIj1w7CLOD wRkCLlBWwvXWz3oauh1Sv158oSF2qlfrtOoNXDltWJ86anw1EQwpIdDgr8isMqvOcunc w2IQ== 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=TTG39X9zxsef8MpXaTofsFoEUYLaTQ03yVrBJYfMqm4=; b=W+Jbn8QiVqi5Wi14lS2KMb1cAQTAx1l1hwRddH+uHeeqEaBomXR8Ydhsq8VEqKYgCU 8jaUsQbxdSVGYTr57LEw1Y+2L8AOpuKLVRHS8iJE+4r3b0Gi2uS7EzcfeCfYCQauwmkQ cDRCDHBHaV5VLM2IOI50v48fyzK+GDBacPY5+ECqMHX2wsrnnLjqo/OEMD6MgwnA3iNy cMuHPPjkgAy/Pix7dYXRpnALGwmcB8jrkLg/slnnyIe/Qca2bKNTDcBYdtsHxFkiFhv5 CcZjRvLKSFDBdnE4p3O1qEMWU6Ez15am5NqE0dja1Rd3MwfVh3fwA0igaRK+gYOdLBX9 Hxow== X-Gm-Message-State: AOAM530++ADLSz3aNqiJivGMXNtRMEWwnQC+Iiv26DQnzHE+0+IKAzE4 ioPU+SI8QhTe9KEN/ZGBTYV3UJhkKeI= X-Google-Smtp-Source: ABdhPJz5Hke0mCSZ6FuC/R726as3QSk3tYkBBckIpZeWe1p5mBwSE/PpPZ8kZxziti8/khWKiacziQ== X-Received: by 2002:a05:6402:30b0:: with SMTP id df16mr3091065edb.85.1620994719074; Fri, 14 May 2021 05:18:39 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id cr21sm3435157ejc.2.2021.05.14.05.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 05:18:38 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 2/7] kernel-shark: Preserve open graphs when appending data Date: Fri, 14 May 2021 15:18:21 +0300 Message-Id: <20210514121826.161749-3-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514121826.161749-1-y.karadz@gmail.com> References: <20210514121826.161749-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org If the user has already made some selection of graphs to be displayed by the GUI, those particular graphs are likely to be important for him, so it is better to keep this configuration after the data file is appended. The opposite can be annoying for the user. Signed-off-by: Yordan Karadzhov (VMware) --- src/KsGLWidget.cpp | 40 ++++++++++++++++++++++++++-------------- src/KsGLWidget.hpp | 4 +++- src/KsMainWindow.cpp | 7 ++++--- src/KsTraceGraph.cpp | 10 +++++++--- src/KsTraceGraph.hpp | 2 +- src/KsUtils.cpp | 1 + 6 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/KsGLWidget.cpp b/src/KsGLWidget.cpp index 9f8e43b..8aab7b3 100644 --- a/src/KsGLWidget.cpp +++ b/src/KsGLWidget.cpp @@ -409,25 +409,12 @@ void KsGLWidget::keyReleaseEvent(QKeyEvent *event) */ #define KS_MAX_START_PLOTS 16 -/** - * @brief Load and show trace data. - * - * @param data: Input location for the KsDataStore object. - * KsDataStore::loadDataFile() must be called first. - */ -void KsGLWidget::loadData(KsDataStore *data) +void KsGLWidget::_defaultPlots(kshark_context *kshark_ctx) { - kshark_context *kshark_ctx(nullptr); QVector streamIds, plotVec; uint64_t tMin, tMax; int nCPUs, nBins; - if (!kshark_instance(&kshark_ctx) || !kshark_ctx->n_streams) - return; - - loadColors(); - - _data = data; _model.reset(); _streamPlots.clear(); @@ -463,6 +450,31 @@ void KsGLWidget::loadData(KsDataStore *data) tMin = _data->rows()[0]->ts; tMax = _data->rows()[_data->size() - 1]->ts; ksmodel_set_bining(_model.histo(), nBins, tMin, tMax); +} + +/** + * @brief Load and show trace data. + * + * @param data: Input location for the KsDataStore object. + * KsDataStore::loadDataFile() must be called first. + * @param resetPlots: If true, all existing graphs are closed + * and a default configuration of graphs is displayed + * (all CPU plots). If false, the current set of graphs + * is preserved. + */ +void KsGLWidget::loadData(KsDataStore *data, bool resetPlots) +{ + kshark_context *kshark_ctx(nullptr); + + if (!kshark_instance(&kshark_ctx) || !kshark_ctx->n_streams) + return; + + loadColors(); + + _data = data; + if (resetPlots) + _defaultPlots(kshark_ctx); + _model.fill(_data); } diff --git a/src/KsGLWidget.hpp b/src/KsGLWidget.hpp index 629ae37..6a72a35 100644 --- a/src/KsGLWidget.hpp +++ b/src/KsGLWidget.hpp @@ -101,7 +101,7 @@ public: void keyReleaseEvent(QKeyEvent *event); - void loadData(KsDataStore *data); + void loadData(KsDataStore *data, bool resetPlots); void loadColors(); @@ -326,6 +326,8 @@ private: int _getLastCPU(struct kshark_trace_histo *histo, int bin, int sd, int pid); + void _defaultPlots(kshark_context *kshark_ctx); + void _deselect(); int _bin0Offset() {return _labelSize + 2 * _hMargin;} diff --git a/src/KsMainWindow.cpp b/src/KsMainWindow.cpp index fa893ce..1cbec55 100644 --- a/src/KsMainWindow.cpp +++ b/src/KsMainWindow.cpp @@ -1283,7 +1283,8 @@ void KsMainWindow::_load(const QString& fileName, bool append) QApplication::processEvents(); _view.reset(); - _graph.reset(); + if (!append) + _graph.reset(); auto lamLoadJob = [&, this] () { QVector v; @@ -1333,7 +1334,7 @@ void KsMainWindow::_load(const QString& fileName, bool append) _view.loadData(&_data); pb.setValue(175); - _graph.loadData(&_data); + _graph.loadData(&_data, !append); pb.setValue(195); } @@ -1454,7 +1455,7 @@ void KsMainWindow::loadSession(const QString &fileName) _view.loadData(&_data); pb.setValue(155); - _graph.loadData(&_data); + _graph.loadData(&_data, true); _filterSyncCBoxUpdate(kshark_ctx); pb.setValue(175); diff --git a/src/KsTraceGraph.cpp b/src/KsTraceGraph.cpp index 1e976df..65e5a79 100644 --- a/src/KsTraceGraph.cpp +++ b/src/KsTraceGraph.cpp @@ -148,12 +148,16 @@ KsTraceGraph::KsTraceGraph(QWidget *parent) * @brief Load and show trace data. * * @param data: Input location for the KsDataStore object. - * KsDataStore::loadDataFile() must be called first. + * KsDataStore::loadDataFile() must be called first. + * @param resetPlots: If true, all existing graphs are closed + * and a default configuration of graphs is displayed + * (all CPU plots). If false, the current set of graphs + * is preserved. */ -void KsTraceGraph::loadData(KsDataStore *data) +void KsTraceGraph::loadData(KsDataStore *data, bool resetPlots) { _data = data; - _glWindow.loadData(data); + _glWindow.loadData(data, resetPlots); updateGeom(); } diff --git a/src/KsTraceGraph.hpp b/src/KsTraceGraph.hpp index 6e83f21..b1132e0 100644 --- a/src/KsTraceGraph.hpp +++ b/src/KsTraceGraph.hpp @@ -45,7 +45,7 @@ class KsTraceGraph : public KsWidgetsLib::KsDataWidget public: explicit KsTraceGraph(QWidget *parent = nullptr); - void loadData(KsDataStore *data); + void loadData(KsDataStore *data, bool resetPlots); void setMarkerSM(KsDualMarkerSM *m); diff --git a/src/KsUtils.cpp b/src/KsUtils.cpp index ec53267..757f49c 100644 --- a/src/KsUtils.cpp +++ b/src/KsUtils.cpp @@ -785,6 +785,7 @@ int KsDataStore::appendDataFile(const QString &file, int64_t offset) _rows = mergedRows; registerCPUCollections(); + emit updateWidgets(this); return sd; } From patchwork Fri May 14 12:18:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12257675 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 C98EDC43470 for ; Fri, 14 May 2021 12:18:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A24BF6145D for ; Fri, 14 May 2021 12:18:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232671AbhENMT5 (ORCPT ); Fri, 14 May 2021 08:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232712AbhENMTx (ORCPT ); Fri, 14 May 2021 08:19:53 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4181CC061756 for ; Fri, 14 May 2021 05:18:41 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id df21so7229665edb.3 for ; Fri, 14 May 2021 05:18:41 -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=H8H19MfKEzKlMMeMpUQNLaugzc0L7lI2BG6f2PIOKyc=; b=gJ8zQ5Tw7GPa7yz/ceUB2VL7tgCFgjhDnlCJ3biN71FHR0r8LZ7tpIZ9yZrfYOw6dq ihSMtluEsECS3AQ8WgnPSv8A9ZIqeohxt2I19ZQyMGtF+DAFS6z6Rzn5mAEAcGXp/Sb9 ++YksNbIXbqbB3D02VmQhhYiwCbeVNYuZQYpdzH28e2Crp0cYd9tdxnVh9AlEU9CoyXW NHGHR+Fq+fG4uhfBWF40TIV3zro5RsTj3QaGpRRGmfLu+3R/fEDu19KAq4v2qyELwTrL 7QmZrHMoMQQZRaSI/sNysRyS1Y3niGK7+2hAJTKAKRwhbIM3AhM052lsVVoLU+EoM7lC R6hg== 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=H8H19MfKEzKlMMeMpUQNLaugzc0L7lI2BG6f2PIOKyc=; b=LLh+3Pj1yMFLA2TIn5wyaTzO7bd+073Ho/lkJhAM09xfkeq25iyslAvIwxK/oT1VZu h4/ULSMBfnAXEchQ6dbsW7jwVMFe2x3cWE00EpS/qQrUrx5YZIq4HifSYd737P/s8I/J 9siO2Z+4E0oplLrZxcuAEqG3900VgqyFYZa5ptRPsXuyZyFpNtn3bEvxZSStLaU/5kO6 atKa4QHvxUF2an0HiJSAcBDMYcjoyJIYeOtsxdf7uiA/uNqcgm1F54JNQSvO6Aqgg1Bv nuSDi+TdtSlChplvJoc5LZEmvwfZo3BLyf1OfivMBuXzLS8MLvXGNUGhak0Zos+Q0l9E QAsw== X-Gm-Message-State: AOAM531wnwUFYmDae7uzhoum/DxhPNuPHTGDmWt8m59FWG/17Qjp4Qep BQ4hlln+DWrCt5+PRhJv1XBClagg8JY= X-Google-Smtp-Source: ABdhPJyQ2Q2qjJn4wTMZO9y6cB63yJA8mzEgpCERkB+cwcq2X6fBTyncRjm+FqeEqyrbKgoQ6gndUg== X-Received: by 2002:aa7:d58b:: with SMTP id r11mr12412475edq.231.1620994719766; Fri, 14 May 2021 05:18:39 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id cr21sm3435157ejc.2.2021.05.14.05.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 05:18:39 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 3/7] kernel-shark: Clear before loading new session Date: Fri, 14 May 2021 15:18:22 +0300 Message-Id: <20210514121826.161749-4-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514121826.161749-1-y.karadz@gmail.com> References: <20210514121826.161749-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Make sure that all already loaded Data streams are properly closed, before loading a new configuration from session description file. Signed-off-by: Yordan Karadzhov (VMware) --- src/KsSession.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/KsSession.cpp b/src/KsSession.cpp index 1e19a5f..b9edb3a 100644 --- a/src/KsSession.cpp +++ b/src/KsSession.cpp @@ -128,6 +128,7 @@ void KsSession::loadDataStreams(kshark_context *kshark_ctx, data->unregisterCPUCollections(); + kshark_close_all(kshark_ctx); dataSize = kshark_import_all_dstreams(kshark_ctx, _config, data->rows_r()); From patchwork Fri May 14 12:18:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12257677 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 3EE59C43462 for ; Fri, 14 May 2021 12:18:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FC286145E for ; Fri, 14 May 2021 12:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232747AbhENMT5 (ORCPT ); Fri, 14 May 2021 08:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232963AbhENMTy (ORCPT ); Fri, 14 May 2021 08:19:54 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4E91C06175F for ; Fri, 14 May 2021 05:18:41 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id t4so44462068ejo.0 for ; Fri, 14 May 2021 05:18:41 -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=pxEhxlhjqSNlLDjkxyRGJ+PZ8OO1QwbqKOC2GyErYZQ=; b=fBgs47Vm/6AiTf49t6Z7A3yxz7r1LFpqnsXi4fBWT/UgcQg1UCyMQ4YEyNZtViAP49 lzyKm1zPBHUpMTSQBmCbotPc5cm2v4L2dV1LrBNEBlktmnuB+L7is7OkiX/SS87Phw2e mBzZdIITko5D9fnefiATWH7xVSLYLoYbr6MaF+Sm7ofcGXb+rSWrQ9Vynq3OhAX0AMrx owsRl9O33Xq7KLlxtLPASlkZdB2Xg78RmoSZw+z7LNZMMxlSgMTgOD2OMxbfzDumAWOF VVNinpb+GqutMuALQPoD/SP5BrP+Onv9dI8mN1YlmraH306E/uupYxXPyywKgrae5KQ6 ygOQ== 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=pxEhxlhjqSNlLDjkxyRGJ+PZ8OO1QwbqKOC2GyErYZQ=; b=PF9JqLYJ/ZM/pM2mA6+y9wAqNYVim+y9EEubmzax2RekeAdmMfLJrRjBBLyne71uk3 lF8Fd7St/MKRTU5vZKBDqgWAP7ovdPbq+gcndazxg+IByNcO6AmfzCfJERJ5Ij88T9BC hEKI7RLLXS8pr4P7fUrG6PO/Ophb45UdHufAMHySpvnJ2eUeH1ySxbQQ7dmpQHl5K4Fe jZMVMkTMYiZ78aFjVBiDLec11+nadlQKDwxVhhM/xsYFXQxEAVu4GZUm/75uRC/Gnpoz WC4TSxY5Asx4scVN68LZiKZ3x5m9+JkczStBC3V/ur189Nxh//IGcOQTXYZ27CuKMrAF ZZ6w== X-Gm-Message-State: AOAM531//XQpolcwbCaBDoPeEUvYRsStxUzNlbC+BQzXOHyiMc16Mrcq 0Fy66l1lUnb9SEq+FmYUHjs9l5TKjLY= X-Google-Smtp-Source: ABdhPJxOf0dIoFCHuAMCRHZExNtnwFXf0Z+fI4IYZzTqONhurCcuxBw2jQb5d1F+ZjdjpHhW/yoJyA== X-Received: by 2002:a17:906:58d6:: with SMTP id e22mr48685139ejs.216.1620994720502; Fri, 14 May 2021 05:18:40 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id cr21sm3435157ejc.2.2021.05.14.05.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 05:18:40 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 4/7] kernel-shark: Better handling of plugins when appending data file Date: Fri, 14 May 2021 15:18:23 +0300 Message-Id: <20210514121826.161749-5-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514121826.161749-1-y.karadz@gmail.com> References: <20210514121826.161749-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org It may sound like a good idea to reinitialize all plugins for all existing Data streams after a new stream is appended, but it isn't. Such reset will re-initialize all Data containers open by the plugins, hence it requires to do a complete reload of all previously loaded data. Currently we reset the plugins but do not reload the data, which is a bug. Because, reloading the data can be slow on large data sets, I prefer to fix the bug, by eliminating the reload of the plugins. Signed-off-by: Yordan Karadzhov (VMware) --- src/KsUtils.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/KsUtils.cpp b/src/KsUtils.cpp index 757f49c..3db8951 100644 --- a/src/KsUtils.cpp +++ b/src/KsUtils.cpp @@ -677,8 +677,7 @@ int KsDataStore::_openDataFile(kshark_context *kshark_ctx, if (kshark_is_tep(kshark_ctx->stream[sd])) { kshark_tep_init_all_buffers(kshark_ctx, sd); - for (int i = 0; i < kshark_ctx->n_streams; ++i) - kshark_tep_handle_plugins(kshark_ctx, i); + kshark_tep_handle_plugins(kshark_ctx, sd); } return sd; From patchwork Fri May 14 12:18:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12257679 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 1EFA8C433B4 for ; Fri, 14 May 2021 12:18:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E951F6145B for ; Fri, 14 May 2021 12:18:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232712AbhENMT5 (ORCPT ); Fri, 14 May 2021 08:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232747AbhENMTx (ORCPT ); Fri, 14 May 2021 08:19:53 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96861C061760 for ; Fri, 14 May 2021 05:18:42 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id b17so34484634ede.0 for ; Fri, 14 May 2021 05:18:42 -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=pIzHPXqbiAaEKSLBqogK8Sd1h6M0//+4RUcFlBIV+uU=; b=IJyuMQW5JN40BxY4pvL/yVjStmi+5qdW4BR6xH1ZgccKkiOPz+9QA7u77RsWvmivTb 0LesLbamvAzvwDcaDqAxXFHTprH1qvRoSzqeZDEuUG/zTotkpHzq/ssFw9s6NvY59KOp def5x3N0eM31A1EOD7zqK09+Z2uwaacf2sugPDVTcjA3ENpr8SxI7DCxe6itu/ycDQW0 XfvgJD/Pi8htjP7qsvueVrj7oB/CkGvYt8u+/Et2AlP4T+5sq7j95xs26RgJC5swroKD erUGdmRP/HqEifA0+ES/Syts5hK3EBCnNpSdBUN1i1xtt3EwaS3S/rsQNTIzqsppzvDu K3ww== 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=pIzHPXqbiAaEKSLBqogK8Sd1h6M0//+4RUcFlBIV+uU=; b=mlwNFeBoB1GIWzHxK2aprb7aH75FJtdgYS3fO8mrg/j717mr6ef9KvJyeORu+xdid1 AVZAx4o7gqTLyVOIca7XjARZDVnDS52kQXeavz5/oGm/TsZeAGIU1iQHE/B6Y5Wtx0ea 5ppx/xwg02IR+rg0O7YcEns2AmvqYnxsmE52FedzVBonBe+eiW33Omkbp6lqHEIf0btw 1/CxWiCiXFkayzhm1noWDPgWPNvf/TQ+/TF/85MRBxfPM5XY+wRx2XOyf4Ql9M+dt97E 6RrUkO8gujr6eLzDNuxeBhvkisY8Q8NplzjlvHKecvaghzR+K7YpfA8Rs+M7wZ1Oaqwt endg== X-Gm-Message-State: AOAM533i2PFoPo/iLCPXC7FVKxuIna9GvmjePv4/HZpKipp7K8CjQ3W+ EGlxauDXugChZxUhU41zhX0hz2qVjFk= X-Google-Smtp-Source: ABdhPJxbNefFdsyOyExAoyaO8YGu6i7A0qV6HdPsF4yCU3Rv0eNe+/+lx49xCkHpCGsK/mSplRY8/A== X-Received: by 2002:a05:6402:19b9:: with SMTP id o25mr50621553edz.192.1620994721167; Fri, 14 May 2021 05:18:41 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id cr21sm3435157ejc.2.2021.05.14.05.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 05:18:40 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 5/7] kernel-shark: Do draw the combo point of the mark Date: Fri, 14 May 2021 15:18:24 +0300 Message-Id: <20210514121826.161749-6-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514121826.161749-1-y.karadz@gmail.com> References: <20210514121826.161749-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org The lines of the code that initialize and plot the combo point are missing in the original commit. Fixing: fc14e40 (kernel-shark: Add combo point to Mark) Signed-off-by: Yordan Karadzhov (VMware) --- src/KsPlotTools.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/KsPlotTools.cpp b/src/KsPlotTools.cpp index abef5f8..1d63a9b 100644 --- a/src/KsPlotTools.cpp +++ b/src/KsPlotTools.cpp @@ -680,6 +680,8 @@ Mark::Mark() _cpu._size = 5.5f; _task._color = Color(0, 255, 0); _task._size = 5.5f; + _combo._color = Color(100, 150, 255); + _combo._size = 5.5f; } void Mark::_draw(const Color &col, float size) const @@ -691,6 +693,7 @@ void Mark::_draw(const Color &col, float size) const _cpu.draw(); _task.draw(); + _combo.draw(); } /** From patchwork Fri May 14 12:18:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12257681 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 A7363C43600 for ; Fri, 14 May 2021 12:18:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 896C661285 for ; Fri, 14 May 2021 12:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232963AbhENMT6 (ORCPT ); Fri, 14 May 2021 08:19:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232354AbhENMTz (ORCPT ); Fri, 14 May 2021 08:19:55 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64975C061761 for ; Fri, 14 May 2021 05:18:43 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id lz27so3045200ejb.11 for ; Fri, 14 May 2021 05:18:43 -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=zUYNHfjMNsJRyZJGjcbcerI76uJyF4Rnzq4Si4Zxp14=; b=Sg542uTuYVYzeEW4HT0mRLUFps5pIAU3ljTnx46S/0g89h1n08rIk3QXthJkLsnFHS FW1eIltkav1BgzXr/4gnToqteJZzGhQoboKkHXajpxLOthLzhLKkf2ItN2ejJAr3Nbjk 5WhJLOAvnor2oseWDukJg17Vrws527Fd+n3QS9PiNyoHb93cAgb7rSPXYA/omliBTy1l 81U94to6VAiiqqf/Ng1Ra0g9t8pBXEM+5NM5IGgAhY68SSp3hzibJTicNwRU11bJtO53 /WSGPMgxk9hTP+IAf7KxjOz0PRzq9mhHS6m3SLjxFkpJI4shdd4IhATgpiCdTDSl9kEc Bohg== 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=zUYNHfjMNsJRyZJGjcbcerI76uJyF4Rnzq4Si4Zxp14=; b=QjFx7hUk2oNnAaNdEBi4gfvb/Ifwt3hXDNwkjQnR+k51pYcVnfpDW6kw3xWiLqWbc+ vv+rsvELDqLxOvM4BsVM0cHLqHmG/3MZttC2ro8rLd2FeSyFgtnbpH9SdJAOzQR5MaBp INX3fhO54B4MwkkAa7TUhgDkocGy2QqFOkKRuaSnKMsFpSmivXu1Oo9T77moFB+ECKj6 De1miF0c93bq5kU9GPUbAQwHAnHeJNxByKltwIMo7+lp/QossmZCIiAhViwz0cjgGXpA b01XHnnvWKbLhV9mf8PB378bBu7yqYtVjXnFTeeH4JM6/denqoHrVb/VMr2f80EMSVuk cEfQ== X-Gm-Message-State: AOAM531BcA6lJwV4f3pZmjWshi1+RY7nSHWZWfG3SoPunt6sFLcczRmH UiUJxbBkeHVnzeZN6OUUy507aNFcOFM= X-Google-Smtp-Source: ABdhPJzus4t4AB6Mp2jif9ZnTuBPRR8XdnBDKo5TPlQ9aqbOPONgXYGWyMlLSMwD/kufaaVzLVaZYw== X-Received: by 2002:a17:906:63d2:: with SMTP id u18mr48831243ejk.186.1620994721850; Fri, 14 May 2021 05:18:41 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id cr21sm3435157ejc.2.2021.05.14.05.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 05:18:41 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 6/7] kernel-shark: Check if "trace_seq" was destroyed before using it Date: Fri, 14 May 2021 15:18:25 +0300 Message-Id: <20210514121826.161749-7-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514121826.161749-1-y.karadz@gmail.com> References: <20210514121826.161749-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org When closing a "tep" data stream we destroy the "trace_seq" object. However, trace_seq_destroy() sets the buffer to "TRACE_SEQ_POISON" which is different from NULL. It is unfortunate that TRACE_SEQ_POISON is an internal definition of libtraceevent, so we have to redefine it here, but this can be fixed in the future. Signed-off-by: Yordan Karadzhov (VMware) --- src/libkshark-tepdata.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index bc5babb..4a84141 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -29,11 +29,17 @@ #include "libkshark-plugin.h" #include "libkshark-tepdata.h" +/** + * The TEP_SEQ_POISON is to catch the use of + * a trace_seq structure after it was destroyed. + */ +#define TEP_SEQ_POISON ((void *)0xdeadbeef) + static __thread struct trace_seq seq; static bool init_thread_seq(void) { - if (!seq.buffer) + if (!seq.buffer || seq.buffer == TEP_SEQ_POISON) trace_seq_init(&seq); return seq.buffer != NULL; From patchwork Fri May 14 12:18:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12257683 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 E24DBC43603 for ; Fri, 14 May 2021 12:18:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF3BB61285 for ; Fri, 14 May 2021 12:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232354AbhENMT6 (ORCPT ); Fri, 14 May 2021 08:19:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232478AbhENMT4 (ORCPT ); Fri, 14 May 2021 08:19:56 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C32CC061763 for ; Fri, 14 May 2021 05:18:44 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id b25so44315972eju.5 for ; Fri, 14 May 2021 05:18:43 -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=BnoEnZS3w88xtGosGlgdepOl60qxJWhr2OKhUZWO20Y=; b=r8imbmeLezFq7r9LKiBeC86NAzrww8qdSnoTSPriL5FzUXaWaM62UTx3z8ajfpUpzh tVp6nE0suWnsSKv5oU1c0HZ2uJreuIvsxZumme3HVfWhzDHdPrNrIzMHa+le47RMFB9G yz0pawChpqjejBHFRLakqUR86fNTmjvt4wtXDrDtsPJ2srQnWOXTlkrLDY67WEXA/i6C UOzGbNvIObhOJ9c7J2LbD8iOypJBzVM2nj0wckL1yAdeAHqXA/vv9/+JmOQbSJrU7DsX v94G0y7obQLdoQn2Vcs0pXd1ANzGTKxEmAgxfnD2aEC5EU82dTFY3AljcRJHG70Uu3FH 5A/w== 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=BnoEnZS3w88xtGosGlgdepOl60qxJWhr2OKhUZWO20Y=; b=PDjP2YOHlsuSL/ski81VryIuWOnsQTge26ezvuVb12A2cyIBfrCd60tCz1OnZaP98L ApBCuqQgZzg/sPjj8aNl3UX4Kx5TQdIXc243p7ZtIyhp3VJadxRwB50bO3TV9M0R5cre pSS+ZX1leSvhilhVfpO+O6LJnl4QX+oVAOH5sh0cvinKwRw7WS0VCzy2YqIM/dexw0xf 3NwftjpFNEeJcNYCXX3VFFYwBKFcHe5fP22p/QOfRZhFONJAwYQQnDB6Q9Eggb50Ve4q 8QUUWI+neJ2affffj8rhFeQ5mtS2HLHbV92pWrhCy45hR0vh8qUp5UC1Z91B2b/LywzY +9dw== X-Gm-Message-State: AOAM5305Q8ohsOYl5ZMifF1qdyDEbc93NveNjlELxcfcoPmkH0W/NaaA wVW4fo010MKwumuYuALYcK1m/XAgE2U= X-Google-Smtp-Source: ABdhPJwItGzKGr5yw1E0GILrfr7mp/Yh/4C8CeTtieZ5iWsQuijRcjIGB33wlUlmFpnb6IkTqB+z+A== X-Received: by 2002:a17:907:248c:: with SMTP id zg12mr1176418ejb.268.1620994722645; Fri, 14 May 2021 05:18:42 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id cr21sm3435157ejc.2.2021.05.14.05.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 05:18:42 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 7/7] kernel-shark: Quiet the warning printing from libtraceevent Date: Fri, 14 May 2021 15:18:26 +0300 Message-Id: <20210514121826.161749-8-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210514121826.161749-1-y.karadz@gmail.com> References: <20210514121826.161749-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org All those warning messages are not really relevant for the users of the GUI. Signed-off-by: Yordan Karadzhov (VMware) --- src/libkshark-tepdata.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index 4a84141..323383f 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -45,6 +45,14 @@ static bool init_thread_seq(void) return seq.buffer != NULL; } +//! @cond Doxygen_Suppress + +void tep_warning(const char *fmt, ...) {} + +void pr_stat(const char *fmt, ...) {} + +//! @endcond + /** Structure for handling all unique attributes of the FTRACE data. */ struct tepdata_handle { /** Page event used to parse the page. */