From patchwork Tue Apr 27 16:24:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12226975 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.7 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,URIBL_BLOCKED,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 746D2C433B4 for ; Tue, 27 Apr 2021 16:25:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 531D0613E7 for ; Tue, 27 Apr 2021 16:25:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238733AbhD0Q02 (ORCPT ); Tue, 27 Apr 2021 12:26:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238912AbhD0QZh (ORCPT ); Tue, 27 Apr 2021 12:25:37 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D882AC061357 for ; Tue, 27 Apr 2021 09:24:25 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id z5so34182502edr.11 for ; Tue, 27 Apr 2021 09:24:25 -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=ktS8d29WmI4vDBg3JU2EubAOGZVHG93P5flV+mY3KXY=; b=vf4i5yoT2ebu+BknXlM4nArSjRn1IXtxkvHp5k3uBwshxtbhnfumJ+FT8scfJbjL8P RDyc9sZOYHj2IsXqjK9pz21cY/oZbeAb8KSVitoT2xr6awQPs+qfw35e69vGc6U6V/bt iOnXsQoNvXGdrupebyb0K2U5DC7jZ1Fu+ZDTLJzm4id+QzuuKCj+CoRCcQ+AHZBBvP4v xAzLGiBMlPOwf8vaybIKpW2Px7qP+dOoFxXf+qoZOkpfY9yr+DPCEnrNOcKVF/j9yMSk +w++327YwZoWgLQaqKuIqPJYed38kd1oxAUpjz9IXALPp6ikAdogV2ZnBfiWnc9gsXZ1 akFg== 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=ktS8d29WmI4vDBg3JU2EubAOGZVHG93P5flV+mY3KXY=; b=IOcYkN2kRv7yJXBuBRfDGbA/a3IOACpJy6T6G8989N+UIu0xV4wP/LWJEvJaIR555F Ckbg3x5BbmG7Yi6Zf5yqzoE+txtyAPkbkMUXG5Ga6W6bPgcpLBk71RpnqPqYJcBnAwlv cfnbDQxDSrO7a3MiXsufXeigrbhAczApu7US9BjYcAXYL3H+suY89win9DOzktkhj0BC R+cY0Kqlo/pOq576OwpU/Bp9CW03a+IkUsOU5YAgyBJjBHijRbAKaZfjJYHJr0eBQi7z 50vMkjoxbRyoa1+KNQ7bAGr/P5YVlVnQwkHM5tiQWytf84ztiKRSLE5MV9R+Nh58f3A/ +3UA== X-Gm-Message-State: AOAM532HgOQ+f4ksuqghUqokoo0Vj3X9wLwSZF0+bnOpUSCwpNzw41XD +EXWc7yD/lvAmEZW9YNF4N6XD868ueY= X-Google-Smtp-Source: ABdhPJwYRQgJy3hAAtUMaSMsnljCpM8NH/CmF9J5N43GPJJmLjNAO9JvOn+/PM2mmG8l/pZfLdAgGw== X-Received: by 2002:aa7:d5c7:: with SMTP id d7mr5505599eds.114.1619540664328; Tue, 27 Apr 2021 09:24:24 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id d15sm2740284edu.86.2021.04.27.09.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 09:24:24 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" , Alan Mikhak Subject: [PATCH 1/7] kernel-shark: Fix the build for 32b systems Date: Tue, 27 Apr 2021 19:24:02 +0300 Message-Id: <20210427162408.134001-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210427162408.134001-1-y.karadz@gmail.com> References: <20210427162408.134001-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org All warnings and errors when building on 32bit Linux systems are fixed. Reported-by: Alan Mikhak Signed-off-by: Yordan Karadzhov (VMware) --- src/KsSession.cpp | 2 +- src/libkshark-configio.c | 2 +- src/libkshark-tepdata.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KsSession.cpp b/src/KsSession.cpp index 8d489f7..1e19a5f 100644 --- a/src/KsSession.cpp +++ b/src/KsSession.cpp @@ -587,7 +587,7 @@ void KsSession::saveDualMarker(KsDualMarkerSM *dm) */ void KsSession::loadDualMarker(KsDualMarkerSM *dm, KsTraceGraph *graphs) { - uint64_t pos; + size_t pos; dm->reset(); dm->setState(DualMarkerState::A); diff --git a/src/libkshark-configio.c b/src/libkshark-configio.c index 98098da..9a1ba60 100644 --- a/src/libkshark-configio.c +++ b/src/libkshark-configio.c @@ -567,7 +567,7 @@ static bool kshark_trace_file_from_json(const char **file, const char **name, } if (st.st_mtime != time) { - fprintf(stderr, "Timestamp mismatch! (%li!=%li)\nFile %s\n", + fprintf(stderr, "Timestamp mismatch! (%" PRIu64 "!=%li)\nFile %s\n", time, st.st_mtime, file_str); return false; } diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index 4e76ef2..bc5babb 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -1025,7 +1025,7 @@ static char *tepdata_dump_entry(struct kshark_data_stream *stream, free(info); } else { n = asprintf(&entry_str, - "%i; %li; [UNKNOWN TASK]-%i; CPU %i; ; [UNKNOWN EVENT]; [NO INFO]; 0x%x", + "%i; %" PRIu64 "; [UNKNOWN TASK]-%i; CPU %i; ; [UNKNOWN EVENT]; [NO INFO]; 0x%x", entry->stream_id, entry->ts, interface->get_pid(stream, entry), From patchwork Tue Apr 27 16:24:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12226979 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 327ABC433B4 for ; Tue, 27 Apr 2021 16:25:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01F7961027 for ; Tue, 27 Apr 2021 16:25:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238916AbhD0Q0c (ORCPT ); Tue, 27 Apr 2021 12:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238927AbhD0QZi (ORCPT ); Tue, 27 Apr 2021 12:25:38 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 721A8C061358 for ; Tue, 27 Apr 2021 09:24:26 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id e7so70590082edu.10 for ; Tue, 27 Apr 2021 09:24:26 -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=fzEgHU4+iYy8isoiMjMORmtrb8HCDvmgUOveuZzhBHs=; b=HV22esFPHrXuDcCddR6fVdfHOMLMbOiZv7jXF+QEYc+01g7GKZsdhOX1Fqzvrj6TyB mzq+qj6CUdz814sJYaypfm088toqcOVPG0UIqmbEkym1kL5C9XwB34qX8TOXMG/A7+w9 ZDLSTy4qs3GbrxX+T/mC0HY9vBB6Y4b+1o4IYw/snMa+NNy5Sd9pCQTe6WXszohUV2+u OJsNnFkMQcIxjoeLBdPdjdgoZsRxzJenmkEgvv/CoqTrQhU8gsuR3YxO63yAi5VAiidQ 9y7XLt8V2W4/4fpIT+6Aq3s2Z3NHZ+X+8TagLnpg/GsOYAEnbCXTx8ExQtlxMSGSrsLa 7rMg== 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=fzEgHU4+iYy8isoiMjMORmtrb8HCDvmgUOveuZzhBHs=; b=VYfbyl1vRGriVsbDg37ExQJeDuqqjtk7Kn/HWOeHAuKneVdD6G7VBcGsdyHn06aPOZ gWmVDnTynd0lJ7cwjeg5k8Eir1FbyKhq57kp5m3sXaoofc94m3ZK9A9b+tCBraIENMsm yDC/Fy1AIMZGP/mPs0K35tx4z3oQ3fi1Sl4harxV7bHdqXL7xVD7Am/k8cCl7+oXyHU9 1GzcBA+KXlIp5ARMIk+kJTHnSKuB3Mk8XkDjbb2Fa71S4SeR8PmYBXtyAvTn+m/VkPy0 FzW6Bk6PKgioYfE3lCwNRQmo0elmjrInvBlT/OCreKXw3Bd8v7tj64+nfBH0arHBrrsb 32JQ== X-Gm-Message-State: AOAM530jWCV1aJteZ19wQmEYuA9TfM9DQOzEvoIApZZwpLrtJksPipTz QHBrIJ6gxK7UrdIcLj1uNFORSKpMpH0= X-Google-Smtp-Source: ABdhPJxGh12bN6o07XiN4mUWtbFZmVLtFS4CDO4k5BqU/Dyt98w3VIHrQoPtmKX7widI41euE67gsQ== X-Received: by 2002:a05:6402:382:: with SMTP id o2mr5446537edv.370.1619540665068; Tue, 27 Apr 2021 09:24:25 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id d15sm2740284edu.86.2021.04.27.09.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 09:24:24 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 2/7] kernel-shark: Add "cron" job to workflows Date: Tue, 27 Apr 2021 19:24:03 +0300 Message-Id: <20210427162408.134001-3-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210427162408.134001-1-y.karadz@gmail.com> References: <20210427162408.134001-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org The CI testing will execute automatically once a week on Thursday 3PM UTC. Signed-off-by: Yordan Karadzhov (VMware) --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4125354..925e235 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,9 @@ name: KernelShark CI (CMAKE) -on: [push] +on: + push: + schedule: + - cron: '0 15 * * THU' env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) From patchwork Tue Apr 27 16:24:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12226981 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 0053DC433B4 for ; Tue, 27 Apr 2021 16:26:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDBCF61164 for ; Tue, 27 Apr 2021 16:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238808AbhD0Q0w (ORCPT ); Tue, 27 Apr 2021 12:26:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237408AbhD0QZ5 (ORCPT ); Tue, 27 Apr 2021 12:25:57 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AEE7C06135B for ; Tue, 27 Apr 2021 09:24:27 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id d14so6855117edc.12 for ; Tue, 27 Apr 2021 09:24:27 -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=xZzs1ISpwrRvRkWW4R8VYE7rlqoWWCme5uCOsIPHhfc=; b=NYi+LyNB/Ih4rxCjZqXnRZR1J+f3FDz8beefvIw1DhjIFkMhVTd1dIpniZXkFeJgQu w9Bp9xjQBh6YMkEULE1ba6j+Gakk0HpfbCEylQT2uOilUlgAwnnPDkPTJE9NZ1IGgyjS z8OEaypCjawWWTk6X3mx1i2vwOwTsw2TJoaHuGKhBhbhncd+ooM8QdUdXKskL8OUh9rC 4K/u5rRb4zHntYP7NwhkiPpVr+uPwQJduVcASui+jNmUFybHBRnUsDcH/7WRZ/8gQgzr OXWI44qly942eetxfr165rdAxHyqAddPgdrKJy6t/kymw76/f5YFDlE3aCJYQus5oUUU Y66w== 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=xZzs1ISpwrRvRkWW4R8VYE7rlqoWWCme5uCOsIPHhfc=; b=X1Avw2VKlGeB4KRqk1vrUTMQQcyTAe3wZ/2ANTR4f739oG98P80KZerhqlhg/dWbsd ROeGxf/kUWs1+esdwX2bEfhhnaJ3LLd+BYXEvtu3DsdHCAvmeddDGNRy5AeKlMf/SPpI keMn9csBT7z+behycbkj6V93RvI7oJkvpSdl3SE7h9zSXL0bP2xbC4HzxTaXi+dLFRcj R6aL1v56WYILF85mvn7zUfYEkFSLwfBlszTiPKrahnG/ymeUypnk0a+MQIFIVhgwPbu6 M02I/6y+JUI2H7INPFgbZPonojAG7ahV0vOKTIhs8bQY/JdWVbAYgRQakx4IzDiVjFEk 1Wlw== X-Gm-Message-State: AOAM5313rQkfIVXCBycrVk+oR3FT6V79diMJu1CV1O/dY2j2lxdmeaQv l4UHJjc/FJGoSSBUWv8LQdenhRWf7p4= X-Google-Smtp-Source: ABdhPJysi6gz525uHuer3OzdJi0gex52av//elZdGvZW0JwhTjlF9zrOgw0KbeqGh6ssBQm8pUhWCA== X-Received: by 2002:aa7:c049:: with SMTP id k9mr5380382edo.56.1619540665734; Tue, 27 Apr 2021 09:24:25 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id d15sm2740284edu.86.2021.04.27.09.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 09:24:25 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 3/7] kernel-shark: Fix KS_DEFINE_PLUGIN_CONTEXT macro Date: Tue, 27 Apr 2021 19:24:04 +0300 Message-Id: <20210427162408.134001-4-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210427162408.134001-1-y.karadz@gmail.com> References: <20210427162408.134001-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org The KS_DEFINE_PLUGIN_CONTEXT macro implements methods that are used to deal with plugin-specific context objects. However, when this macro is used in multiple plugins and those plugins are loaded together the symbol resolving fails, resulting in undefined behavior. Namely, version of the function from one plugin, being called by another plugin. Here we make sure that the methods defined in KS_DEFINE_PLUGIN_CONTEXT are not visible outside of the corresponding plugin. Fixing: 15df009 (kernel-shark: Add KS_DEFINE_PLUGIN_CONTEXT macro) Signed-off-by: Yordan Karadzhov (VMware) --- src/libkshark-plugin.h | 22 ++++++++++++++++++---- src/plugins/sched_events.c | 3 +++ src/plugins/sched_events.h | 3 +-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/libkshark-plugin.h b/src/libkshark-plugin.h index c110616..752dbeb 100644 --- a/src/libkshark-plugin.h +++ b/src/libkshark-plugin.h @@ -24,6 +24,8 @@ extern "C" { /* Quiet warnings over documenting simple structures */ //! @cond Doxygen_Suppress +#define __hidden __attribute__((visibility ("hidden"))) + #define _MAKE_STR(x) #x #define MAKE_STR(x) _MAKE_STR(x) @@ -364,11 +366,14 @@ int kshark_handle_all_dpis(struct kshark_data_stream *stream, __ok; \ }) \ -/** General purpose macro defining methods for adding plugin context. */ +/** + * General purpose macro defining methods for adding plugin context. + * Do not use this macro in header files. + */ #define KS_DEFINE_PLUGIN_CONTEXT(type) \ static type **__context_handler; \ static ssize_t __n_streams = -1; \ -static inline type *__init(int sd) \ +__hidden type *__init(int sd) \ { \ type *obj; \ if (__n_streams < 0 && sd < KS_DEFAULT_NUM_STREAMS) { \ @@ -388,7 +393,7 @@ static inline type *__init(int sd) \ __context_handler[sd] = obj; \ return obj; \ } \ -static inline void __close(int sd) \ +__hidden void __close(int sd) \ { \ if (sd < 0) { \ free(__context_handler); \ @@ -398,13 +403,22 @@ static inline void __close(int sd) \ free(__context_handler[sd]); \ __context_handler[sd] = NULL; \ } \ -static inline type *__get_context(int sd) \ +__hidden type *__get_context(int sd) \ { \ if (sd < 0 || sd >= __n_streams) \ return NULL; \ return __context_handler[sd]; \ } \ +/** + * General purpose macro declaring the methods for adding plugin context. + * To be used in header files. + */ +#define KS_DECLARE_PLUGIN_CONTEXT_METHODS(type) \ +type *__init(int sd); \ +void __close(int sd); \ +type *__get_context(int sd); \ + #ifdef __cplusplus } #endif // __cplusplus diff --git a/src/plugins/sched_events.c b/src/plugins/sched_events.c index ac4a7bf..5798322 100644 --- a/src/plugins/sched_events.c +++ b/src/plugins/sched_events.c @@ -73,6 +73,9 @@ int plugin_sched_get_prev_state(ks_num_field_t field) return (field & mask) >> PREV_STATE_SHIFT; } +/** A general purpose macro is used to define plugin context. */ +KS_DEFINE_PLUGIN_CONTEXT(struct plugin_sched_context); + static bool plugin_sched_init_context(struct kshark_data_stream *stream, struct plugin_sched_context *plugin_ctx) { diff --git a/src/plugins/sched_events.h b/src/plugins/sched_events.h index 78cfda0..2c540fd 100644 --- a/src/plugins/sched_events.h +++ b/src/plugins/sched_events.h @@ -53,8 +53,7 @@ struct plugin_sched_context { struct kshark_data_container *sw_data; }; -/** A general purpose macro is used to define plugin context. */ -KS_DEFINE_PLUGIN_CONTEXT(struct plugin_sched_context); +KS_DECLARE_PLUGIN_CONTEXT_METHODS(struct plugin_sched_context) /** The type of the data field stored in the kshark_data_container object. */ typedef int64_t ks_num_field_t; From patchwork Tue Apr 27 16:24:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12226985 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 7BF3BC433ED for ; Tue, 27 Apr 2021 16:26:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 466A6613DD for ; Tue, 27 Apr 2021 16:26:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238034AbhD0Q1B (ORCPT ); Tue, 27 Apr 2021 12:27:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238852AbhD0QZ6 (ORCPT ); Tue, 27 Apr 2021 12:25:58 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17471C06135C for ; Tue, 27 Apr 2021 09:24:28 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id i24so11091141edy.8 for ; Tue, 27 Apr 2021 09:24:28 -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=uPuP16XLbqaUCOs/SjKf2uENt8+iP9lH4i9xPgdBYUM=; b=ehAVyq1VnZjO5GCTjWoBYyARys25zx0f5GzPtYAQGTSIHKF/VIiYFSQJw50d89/Xfx oZ0xJd63B5I4H4GpCA9T5FQuZ/NuhSwHyG09k+X2HipeCTZNJ6xfBieAeDVwSxRrsrBN ah2YT9NLQx5nxig8DKoYeZMBZnGQccegpRDcDs4w3idueqws3ustCieE0wHreXQjwjQW a+GHwPZ5p8vxjHNrdwrITK+uGvzrQ483LWoxxOuAXFgiUemjVsdJP77EusCSuwExMvIg 0QxOEvYPP/P6YAJtgeW+6twWHxBc8oq5hvYsrgMJ0I0IbAEzcLA5feH8efmW0lCxmLcd ZZHg== 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=uPuP16XLbqaUCOs/SjKf2uENt8+iP9lH4i9xPgdBYUM=; b=dQ0SwShmlSrG0agSS3nFJQcWWFBn/GPjA29MZkC0zNXJnw7Ml/OQ1qa6xv0hwMUKlz BTwxUtCSgwgcC5BRrynbdOLxYdAO5fprRyt7Rz+76Y5wRncKyr8sGsPGmbUn6QykZ9RH uE21hWztKwNO5jrq5M2wQRM2ALv7mrC/6YrwJH/VQAr+a5IeVVgTq7grLLcGp2dYcF/w DrLAUVeSowqygve/Rtt1WfHzCj8X99cIVP5ZaG0hjxrKFh3dgePWCNpkK8z5gVanyCDd gdoOtlNn0OyADj9zJoojPVwwS0OjMaNImHjePM9Gf5EMZjipJ8JIcqj3Yv4ZrmA7axba Yv7w== X-Gm-Message-State: AOAM533RpVBJfPM38gusuVRnWz3x6u06FCB6eaBfQ8QkO0ulSlxluUo0 yebOjhCyE4uwf/IRDwtbokKUZjM0tqg= X-Google-Smtp-Source: ABdhPJwGa2KCD/PZ0e32vZ++OnymEKOD+ZfOSnjl73Ykigy24tiZtl/dmOYi4W/fKwGmIkJn1zNf0w== X-Received: by 2002:aa7:dd01:: with SMTP id i1mr4710080edv.232.1619540666686; Tue, 27 Apr 2021 09:24:26 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id d15sm2740284edu.86.2021.04.27.09.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 09:24:26 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 4/7] kernel-shark: Add cleanup of all plugin contexts Date: Tue, 27 Apr 2021 19:24:05 +0300 Message-Id: <20210427162408.134001-5-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210427162408.134001-1-y.karadz@gmail.com> References: <20210427162408.134001-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org The when the macro KS_DEFINE_PLUGIN_CONTEXT is used by the plugin, the final free of the memory is done by calling __close() with a negative stream id. Althow, this was provisioned in the definition of the macro, it was never implemented in the GUI. Signed-off-by: Yordan Karadzhov (VMware) --- src/libkshark-plugin.c | 10 ++++++++++ src/libkshark-plugin.h | 5 ++++- src/libkshark.h | 2 +- src/plugins/sched_events.c | 4 ++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/libkshark-plugin.c b/src/libkshark-plugin.c index ebd2579..09886ce 100644 --- a/src/libkshark-plugin.c +++ b/src/libkshark-plugin.c @@ -117,6 +117,9 @@ int kshark_unregister_event_handler(struct kshark_data_stream *stream, { struct kshark_event_proc_handler **last; + if (stream->stream_id < 0) + return 0; + for (last = &stream->event_handlers; *last; last = &(*last)->next) { if ((*last)->id == event_id && (*last)->event_func == evt_func) { @@ -182,6 +185,9 @@ void kshark_unregister_draw_handler(struct kshark_data_stream *stream, { struct kshark_draw_handler **last; + if (stream->stream_id < 0) + return; + for (last = &stream->draw_handlers; *last; last = &(*last)->next) { if ((*last)->draw_func == draw_func) { struct kshark_draw_handler *this_handler; @@ -410,12 +416,16 @@ void kshark_unregister_plugin(struct kshark_context *kshark_ctx, */ void kshark_free_plugin_list(struct kshark_plugin_list *plugins) { + struct kshark_data_stream stream; struct kshark_plugin_list *last; + stream.stream_id = KS_PLUGIN_CONTEXT_FREE; while (plugins) { last = plugins; plugins = plugins->next; + if (last->process_interface) + last->process_interface->close(&stream); free_plugin(last); } } diff --git a/src/libkshark-plugin.h b/src/libkshark-plugin.h index 752dbeb..85a0a8c 100644 --- a/src/libkshark-plugin.h +++ b/src/libkshark-plugin.h @@ -366,6 +366,9 @@ int kshark_handle_all_dpis(struct kshark_data_stream *stream, __ok; \ }) \ +/** Identifier used to free the plugin context. */ +#define KS_PLUGIN_CONTEXT_FREE -1 + /** * General purpose macro defining methods for adding plugin context. * Do not use this macro in header files. @@ -395,7 +398,7 @@ __hidden type *__init(int sd) \ } \ __hidden void __close(int sd) \ { \ - if (sd < 0) { \ + if (sd == KS_PLUGIN_CONTEXT_FREE) { \ free(__context_handler); \ __n_streams = -1; \ return; \ diff --git a/src/libkshark.h b/src/libkshark.h index aa4b3ca..ee3a1d3 100644 --- a/src/libkshark.h +++ b/src/libkshark.h @@ -281,7 +281,7 @@ struct kshark_generic_stream_interface { /** Structure representing a stream of trace data. */ struct kshark_data_stream { /** Data stream identifier. */ - uint16_t stream_id; + int16_t stream_id; /** The number of CPUs presented in this data stream. */ int n_cpus; diff --git a/src/plugins/sched_events.c b/src/plugins/sched_events.c index 5798322..5c82803 100644 --- a/src/plugins/sched_events.c +++ b/src/plugins/sched_events.c @@ -201,6 +201,9 @@ int KSHARK_PLOT_PLUGIN_DEINITIALIZER(struct kshark_data_stream *stream) struct plugin_sched_context *plugin_ctx; int sd = stream->stream_id; + if (sd == KS_PLUGIN_CONTEXT_FREE) + goto close; + plugin_ctx = __get_context(sd); if (!plugin_ctx) return 0; @@ -215,6 +218,7 @@ int KSHARK_PLOT_PLUGIN_DEINITIALIZER(struct kshark_data_stream *stream) kshark_unregister_draw_handler(stream, plugin_draw); + close: __close(sd); return 1; From patchwork Tue Apr 27 16:24:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12226983 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 76144C433B4 for ; Tue, 27 Apr 2021 16:26:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3F567613E8 for ; Tue, 27 Apr 2021 16:26:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236696AbhD0Q1A (ORCPT ); Tue, 27 Apr 2021 12:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238856AbhD0QZ6 (ORCPT ); Tue, 27 Apr 2021 12:25:58 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E71BFC06135D for ; Tue, 27 Apr 2021 09:24:28 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id t4so7069897ejo.0 for ; Tue, 27 Apr 2021 09:24:28 -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=lW4iHB1552msQ3I1dGGw7R+FZ3bAcMKEqMxqLWDF8v4=; b=G9xoMLbB1gf5f5fm4NjD0tGhVXpsL+Cd/95xdhgfSvGpL7N/LhTLSPFryPDsZsWfek eZOJCOOftzx04HGFv/+RNizz8iJNXJalmiL0nkfeNahjDB3kvreYc90VBuRk55icB5hz cmh5S6CyPmxa3KI3mKEj5GU4ult3DstEvS0a4B8TQzYdW+qpF6awirsOoKskyaL4SR0q 2LYHhYNH3dKadnRfPgPGNP+tjdHxELiGJhnYE2YiCrc9ESkv2q4MfFRPcMobIsjPJELD Yktksj+WIAY5pT77G5aKe8TbTEYDH7s3HktCMfcpyE9DwTgOgVHF28WwHgf3FiiQmRSS eYPA== 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=lW4iHB1552msQ3I1dGGw7R+FZ3bAcMKEqMxqLWDF8v4=; b=diCJJ0EUZxjlmcnlh3e5NrAOiWXOqHMKw9QvTyGb0N8xUVy3/+1NgTdX+yFjERydsJ hT/oRDrabfeGrFPiwhAXX+Ou43TE1dzlR/yviuhT2egwfwS0ftvlzWDWAitjkO8GetAj vS88dp9srK0RolMHL39mwWFAHaEySn8kYJcN+tOg1dQBAlGPwpJpHLiKLzhhTrTn0YJa li6iSG5s+H9nQSb9LoTpKeNOuMi7Q5JZ9XisWkC5vvIZCFQeMfHWaBx/fRYX7Ml88gyR AwPzeWpZTEcNQhwL3Lh/qZEMBhw79VOwlBi4uxHHaWYbW9sx+dPp2izkeYSV28TWWERF quKA== X-Gm-Message-State: AOAM532eiZwiNMAzUSUqfLvTrBbn4Wz7alf7r1IeqnzucF2HthtTWx9B OucK1RLMUuZ86ZpO9B9HQ0/mCDjXXu8= X-Google-Smtp-Source: ABdhPJxmpt9JbhK5x9tC1ORccr87t+Heqz903K/01Lpefo/FnkiEyva1YusKBADnYgFT+e7AKqNnuA== X-Received: by 2002:a17:906:3a94:: with SMTP id y20mr23817768ejd.35.1619540667458; Tue, 27 Apr 2021 09:24:27 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id d15sm2740284edu.86.2021.04.27.09.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 09:24:27 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 5/7] kernel-shark: Fix memory leak in "sched events" plugin. Date: Tue, 27 Apr 2021 19:24:06 +0300 Message-Id: <20210427162408.134001-6-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210427162408.134001-1-y.karadz@gmail.com> References: <20210427162408.134001-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org The memory used by the Data container object must be freed. The fix includes improvement of the KS_DEFINE_PLUGIN_CONTEXT macro. Fixing: b39499d (kernel-shark: Speed-up the sched_events plugin) Signed-off-by: Yordan Karadzhov (VMware) --- src/libkshark-plugin.h | 4 ++-- src/plugins/sched_events.c | 14 +++++++++++++- tests/libkshark-tests.cpp | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/libkshark-plugin.h b/src/libkshark-plugin.h index 85a0a8c..4c5fa5a 100644 --- a/src/libkshark-plugin.h +++ b/src/libkshark-plugin.h @@ -373,7 +373,7 @@ int kshark_handle_all_dpis(struct kshark_data_stream *stream, * General purpose macro defining methods for adding plugin context. * Do not use this macro in header files. */ -#define KS_DEFINE_PLUGIN_CONTEXT(type) \ +#define KS_DEFINE_PLUGIN_CONTEXT(type, type_free) \ static type **__context_handler; \ static ssize_t __n_streams = -1; \ __hidden type *__init(int sd) \ @@ -403,7 +403,7 @@ __hidden void __close(int sd) \ __n_streams = -1; \ return; \ } \ - free(__context_handler[sd]); \ + type_free(__context_handler[sd]); \ __context_handler[sd] = NULL; \ } \ __hidden type *__get_context(int sd) \ diff --git a/src/plugins/sched_events.c b/src/plugins/sched_events.c index 5c82803..a66904a 100644 --- a/src/plugins/sched_events.c +++ b/src/plugins/sched_events.c @@ -73,8 +73,20 @@ int plugin_sched_get_prev_state(ks_num_field_t field) return (field & mask) >> PREV_STATE_SHIFT; } +static void sched_free_context(struct plugin_sched_context *plugin_ctx) +{ + if (!plugin_ctx) + return; + + if (plugin_ctx->ss_data) + kshark_free_data_container(plugin_ctx->ss_data); + + if (plugin_ctx->sw_data) + kshark_free_data_container(plugin_ctx->sw_data); +} + /** A general purpose macro is used to define plugin context. */ -KS_DEFINE_PLUGIN_CONTEXT(struct plugin_sched_context); +KS_DEFINE_PLUGIN_CONTEXT(struct plugin_sched_context, sched_free_context); static bool plugin_sched_init_context(struct kshark_data_stream *stream, struct plugin_sched_context *plugin_ctx) diff --git a/tests/libkshark-tests.cpp b/tests/libkshark-tests.cpp index 5f7c88a..3a5b0c3 100644 --- a/tests/libkshark-tests.cpp +++ b/tests/libkshark-tests.cpp @@ -148,7 +148,7 @@ struct test_context { char b; }; -KS_DEFINE_PLUGIN_CONTEXT(struct test_context); +KS_DEFINE_PLUGIN_CONTEXT(struct test_context, free); BOOST_AUTO_TEST_CASE(init_close_plugin) { From patchwork Tue Apr 27 16:24:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12226987 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 14CECC433B4 for ; Tue, 27 Apr 2021 16:26:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D919A613C3 for ; Tue, 27 Apr 2021 16:26:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238852AbhD0Q1D (ORCPT ); Tue, 27 Apr 2021 12:27:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238967AbhD0Q0B (ORCPT ); Tue, 27 Apr 2021 12:26:01 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A507C06135E for ; Tue, 27 Apr 2021 09:24:29 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id r9so90373049ejj.3 for ; Tue, 27 Apr 2021 09:24:29 -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=wDoYhbKqi7r7+XeFLpvtcL7WyvNxB0XsH3vwGXpVVCs=; b=YbsW5t/bi/Gef3GqyZsqqbTRSQIM0hZNsTBqIl/V8MntC8XyaHu8g6pzNe7SNlZfSm pjsKeYFQD0yqmkc3REF98MLWMyYTQF0YXx9MrejUbmviRjK4fmjFdFXQXPjiivIr0Nuh elETqkinhJKpVm22e4Jv2t1/2XHYy8xnZnAhEu1FAQmug68uDZ6RkCMOoVCh0gS8uC9t narcbLqdvQtoYkS4P+cR9CPWsKhRKoU04Ui0HDu4LAUoqGhS5EJsnI3vBYTF3fYX4wJU SARH+5r89VjHbdTOj96r9fc8RE2hsaCRDBGBP8VT5O7wD7+7wJpEHqmjYy1I7Jog81Vl nhsw== 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=wDoYhbKqi7r7+XeFLpvtcL7WyvNxB0XsH3vwGXpVVCs=; b=kYyH5Z6mFPctYnMVkhptrZyk8m7YTJj1TC9mtn0H0dmlvUnkpydax9pDdJH8zBJfw3 nWwiGnNnYIQ0EUHcbKxJyneV/SSvNo+RMxIXBl6OVo2hVUlZ7qQqd08a9FiJ0Q3tj9f1 xGwv+k3AlwqKM3jyeqlZ9nftoCbIw32kOY0fx3zhh7Xboizuus/x8FQWrgB4yboPSAcS c2Q/HXyvtGk/nciTGvXvf0cleQF5VpWTzrVg6cHGaaSC5LCENweWTadbIkELgHo7tbzl DFRyQ/kY4LEpwcNPfMPisMz3YXQggE+pxcuhe4yW/RvI+iN0br7vbj/2guVCXFNxJhsN dFUw== X-Gm-Message-State: AOAM533sUAwTezAhX/7/kRhYg7o7AkkQtDx6tj/GRC2DvB33IQ03CpuB RRrgOuiaKyjSiiK/YBtiG0SxSUssQM8= X-Google-Smtp-Source: ABdhPJyGWglWpxmOwUPLcB1vy6/fq8KYppAX1RAG4pvqsrDM1BZlZCtjfDdIAuKt/AHTWqZ1ijR9JQ== X-Received: by 2002:a17:906:5952:: with SMTP id g18mr4988507ejr.313.1619540668121; Tue, 27 Apr 2021 09:24:28 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id d15sm2740284edu.86.2021.04.27.09.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 09:24:27 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 6/7] kernel-shark: Disable the pop-up offset dialog Date: Tue, 27 Apr 2021 19:24:07 +0300 Message-Id: <20210427162408.134001-7-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210427162408.134001-1-y.karadz@gmail.com> References: <20210427162408.134001-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org The pop-up dialog that asks for the time offset, when a trace data file is appended, is a legacy from the time when we have been doing the calculation of the offset by hand. It still can be useful in some specific cases, but the user can do the same from the "Tools" menu. Signed-off-by: Yordan Karadzhov (VMware) --- src/KsMainWindow.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/KsMainWindow.cpp b/src/KsMainWindow.cpp index e830c5e..d0a434a 100644 --- a/src/KsMainWindow.cpp +++ b/src/KsMainWindow.cpp @@ -1248,7 +1248,7 @@ void KsMainWindow::_load(const QString& fileName, bool append) QString pbLabel("Loading "); bool loadDone = false; struct stat st; - double shift; + double shift(.0); int ret, sd; ret = stat(fileName.toStdString().c_str(), &st); @@ -1264,15 +1264,6 @@ void KsMainWindow::_load(const QString& fileName, bool append) qInfo() << "Loading " << fileName; - if (append) { - bool ok; - shift = KsTimeOffsetDialog::getValueNanoSec(fileName, &ok); - if (ok) - shift *= 1000.; - else - shift = 0.; - } - if (fileName.size() < 40) { pbLabel += fileName; } else { From patchwork Tue Apr 27 16:24:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12226989 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 33143C43461 for ; Tue, 27 Apr 2021 16:26:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F04BD613EF for ; Tue, 27 Apr 2021 16:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237542AbhD0Q1G (ORCPT ); Tue, 27 Apr 2021 12:27:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238973AbhD0Q0G (ORCPT ); Tue, 27 Apr 2021 12:26:06 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E932C06135F for ; Tue, 27 Apr 2021 09:24:30 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id l4so90322526ejc.10 for ; Tue, 27 Apr 2021 09:24:30 -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=da/1BDPs8qFHRz9rAFAjhMeP/98KJF/PClKzxL8bK9g=; b=qKT9Y+yiG1gJSFcR1VSGbaOKjB5KKWgjRyfORGwsfBTJS/cn40ftjBlHqBOK4Zzais hB9bkX8EJsEKDz1HkD4d5ff4UjpZ+o13f9SQP4t9FfUeqAaBEQnaRYN8ctFgo3ars9xP LlZdrLxO1wqUK0YGkUpTcTDO6iWbfRe5xEg+CYzJ7FSG1E8s1ljDPEfR3vhtoEmwF4Cm +Vq3+OJwLwkQVx5b+SdR/xNQOZt9dMxkkHH2a1FvK4MiQ42dYj4n42UDvFJ8byPTdBus wcM6K0rBezjloJIo9Wx3MzVQXbAS/NdVckcVTRnucTBw2fUwlWtie+FsnW0ys+z/za0N uSmQ== 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=da/1BDPs8qFHRz9rAFAjhMeP/98KJF/PClKzxL8bK9g=; b=OSQx/miq0gmQfSoOgQ065YB6cJqlPIMGnAUW4advhPkciChm48qKwIDTjJrm9Of6UF XOSbn6ZGTdVSmC+9ltJaZYQoqGKBUGeh/Anv+lUtYsdBTZtT43qvkp6iuFG8OC3pOVOf f1UyEPoHjnQZSw9IUJmT6nOfsME7IOJTlM5zDya5dmVGN2gspxdhfbcPIuFMla29lfA3 W58D0irSyUAssr+d1QaNAGpdcG70tzgB0OdpQHFl6drNUP/TIQcooOU9oikdF8pat5Ze qoPhrnl1O0SVyajmgemMAggShl2VZf3uXuTyiDmOqu3C0R2ABGS6wrIclTJdltMqXI2b qgmg== X-Gm-Message-State: AOAM531PjdB4AZsSFXmRN6ZCPWKf2EJP8TW4ua5360uTCZLdRKJ+uc0A 2HF8bG9V02LRE5hRvwgFC0jw0NI70EQ= X-Google-Smtp-Source: ABdhPJytBSVS4yK/iVj5PABFgnMQFCiCWJaIOagAT4kBfSiPg9NcdVEuMEV/eowxOYQIyIa56/85/w== X-Received: by 2002:a17:906:b315:: with SMTP id n21mr8252261ejz.219.1619540669007; Tue, 27 Apr 2021 09:24:29 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id d15sm2740284edu.86.2021.04.27.09.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 09:24:28 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH 7/7] kernel-shark: Remove kvm_combo from the list of default plugins Date: Tue, 27 Apr 2021 19:24:08 +0300 Message-Id: <20210427162408.134001-8-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210427162408.134001-1-y.karadz@gmail.com> References: <20210427162408.134001-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org The "kvm_combo" plugin is still under tests and is yet to be added to KernelShark. For the moment we remove it from the list of default plugins for "tep" data, so that no warning message is being printed. Signed-off-by: Yordan Karadzhov (VMware) --- src/libkshark-tepdata.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c index bc5babb..f7cd083 100644 --- a/src/libkshark-tepdata.c +++ b/src/libkshark-tepdata.c @@ -1210,7 +1210,6 @@ static void kshark_tep_init_methods(struct kshark_generic_stream_interface *inte const char *tep_plugin_names[] = { "sched_events", "missed_events", - "kvm_combo", }; /**