From patchwork Wed Apr 28 13:47: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: 12228889 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,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 E3397C433B4 for ; Wed, 28 Apr 2021 13:47:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2C2261158 for ; Wed, 28 Apr 2021 13:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239898AbhD1Nsc (ORCPT ); Wed, 28 Apr 2021 09:48:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239909AbhD1Ns1 (ORCPT ); Wed, 28 Apr 2021 09:48:27 -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 CBEAEC06138B for ; Wed, 28 Apr 2021 06:47:42 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id n25so2207300edr.5 for ; Wed, 28 Apr 2021 06:47: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=ktS8d29WmI4vDBg3JU2EubAOGZVHG93P5flV+mY3KXY=; b=amwgvvXEewVVgFDZoPWt7LJExDMLnwW3qfFb2eaOUT5Lu8rZq3VXbfmhc49qVGH88l cPYvp/zbzFYUzdoNWIBiPngcmCCm0AzTaZfhauSh9mlr0foBV/xBTOhHfAsjg3lw3O6s 52oBRHpZmoHTz/Rz5cRmcBend4KxYDlio0GOQzR2Xqcrpi9HFawHDB5UX9gbphhEAyFb loyClkkbh51vRG5jzacS6hy50kuy6OSpsmgnrbJAAckJEF1hGQ5Pji7mRX2JJJ4aMwko 0BvT6TJC4CuYOqtWYDlmH5o1+BeoZFhKfOumsjXNV4jwEfDuPBNjkpIKx+HZbF2n/Xaf 0pRA== 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=L8HaVIyt6pfstVc5KxqP4xNNuXVxOrLwVDD+BYMvA5P1GlgGa7L92yXSbrOz3spva7 jnhUhdToQ2Jzt3L3Ij/fVvTa/r/O0iDagZcPTIpdXG3S41rArT0UOyVEEhmO062T2rbN ha6vSY6kutyIVNHbLyMJPpctGVcV61TEy+Bj0cworyra1wD/q2dHrbxkajniie4zuQS2 S9jrMVjOQ0lhEjWjijGUjtKz0+OmqWSDVoK7zpN3gwWIdF00y1NVoDYIQRe9OtpMzLvv KpHo2TjUxvWPzakrJMpMh2kUm939NBstu+IpJV+iTjJvQTtf7VLgKz6O63mFIrkeEwfe yQQg== X-Gm-Message-State: AOAM532fc5xOKRkK7Nl8NeRseWa0qu5SRXFF2XqWOapIwpnO3tk0NFPd ifMxqot75HER80v0zmZKvvnV1g5fbsI= X-Google-Smtp-Source: ABdhPJzZfseIjZ1By32k9O5u3NfuQJaTEoB0k0GZ3pVGWSoWMIdKjX3jDXomODJy1lifCEqN6mepLQ== X-Received: by 2002:aa7:cc15:: with SMTP id q21mr11711833edt.140.1619617661396; Wed, 28 Apr 2021 06:47:41 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:41 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" , Alan Mikhak Subject: [PATCH v2 1/9] kernel-shark: Fix the build for 32b systems Date: Wed, 28 Apr 2021 16:47:22 +0300 Message-Id: <20210428134730.187533-2-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-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 Wed Apr 28 13:47: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: 12228891 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,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 72CFCC433ED for ; Wed, 28 Apr 2021 13:47:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B7FF61158 for ; Wed, 28 Apr 2021 13:47:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239915AbhD1Nsd (ORCPT ); Wed, 28 Apr 2021 09:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239917AbhD1Ns3 (ORCPT ); Wed, 28 Apr 2021 09:48:29 -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 7511BC06138F for ; Wed, 28 Apr 2021 06:47:43 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id z5so37804281edr.11 for ; Wed, 28 Apr 2021 06:47: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=fzEgHU4+iYy8isoiMjMORmtrb8HCDvmgUOveuZzhBHs=; b=rY2uA6/wJXbJxG+55bPiDLxXnvFN836xiY0kbz/zIsuPX0nSpDrN+0U79OGnhYFUkd BoAAVO7ixc2Bm4cn+jBkxl65b7Bvzc8EK0alC0wvEpFz+6LR6lTli9QlxDQVWuu5PGFp Uv7uIbMNx85NnDJM6+rtuOq+1IFzyv4LysSVavzaeyxeuCUWro47LB4+a2xtptOQv05y hStDb7bYMo3yjkYGk00RinadSGJneCp5PRvajYkMZKgJwckwQe7cXLbKWOca768iplQ2 f/Gv2bqL8TKTmFUzOELRz2+L9NMJSS8P2rFNQMNT0VWGFGVHHhMps0xUgY5elbIomz5s KeyA== 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=kz0SHtbXYB8XJX757KFDbk5SCJ9yytEc2l2+ccOUkBI3QJNRf+pDpC/rX0WXHWcDM0 DE7nYf/4Iy2x5f60svgCXEFhlVn9FsYQja2cXstGnf9j9HJRlGsDXXYdhLLMgertH18v wHZewFU/9bcfAF0BEMOmBXxDT6qVvBFStDpngMKauQ6xfyoOZ+5mZMHSCKBU32nT3KY1 NOjDSTIpq5Kq0o2G4FrnYNyA6HVrQnFXIdV255248SYCeDamyuthGZa2HhbZRjHuEMLE VUdhH8/8wQAT1Imz8OFIYPF7ihmjPqr9YO6l1NzlwOYP1DMJ+kuD5hQIAUA4ZLvLtyZK qtNA== X-Gm-Message-State: AOAM530/GLeawRmIHcLmW0WF5b7zzyMNLYRSF5frRj+pqDcqM4r2xFAR UgMuuCWv18L+Z2tZFelsnbpEHL0Pfdc= X-Google-Smtp-Source: ABdhPJzdcwKdeUtI7KiWV9eS2d+wBSxIlFDMxOJYykNbeGdD9v+Ml1a0nq2eHkLoceTRgCIThy83CA== X-Received: by 2002:aa7:cb89:: with SMTP id r9mr11523797edt.245.1619617662063; Wed, 28 Apr 2021 06:47:42 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:41 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH v2 2/9] kernel-shark: Add "cron" job to workflows Date: Wed, 28 Apr 2021 16:47:23 +0300 Message-Id: <20210428134730.187533-3-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-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 Wed Apr 28 13:47: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: 12228899 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,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 258C2C43460 for ; Wed, 28 Apr 2021 13:47:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E14E461444 for ; Wed, 28 Apr 2021 13:47:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239908AbhD1Nse (ORCPT ); Wed, 28 Apr 2021 09:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239918AbhD1Nsb (ORCPT ); Wed, 28 Apr 2021 09:48:31 -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 3578BC061574 for ; Wed, 28 Apr 2021 06:47:44 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id h10so74282534edt.13 for ; Wed, 28 Apr 2021 06:47:44 -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=HxfwzhZXy18AUmReU+YompVqhn+HTFpFJzrFFIB8K+0JdVivRxqpWu5O6EZR4Ha6a7 xJIbgnL9iQW5vTV92cPNSQ/6lZjTvvuqaSH/a4FidaFK4TEXdcGmEIJXkCYZSwGDsBUY o83GNkyqcXV4zmT9HeIP91wCO6zJipcF+jGgv92bE3tbySeQDdk50cdiJOjrf6xCczue GQUql0eIFOi22sGIh6IXSinNc6YoQhQJGHspoU+lFqO5gnoPqCa1z7KKxTLVbhLYld3B 2uf/keI/4NOkoitMqpxzs+JiexUgwh7PaCkN4owbbdc7jZWrydofkmuofbZWR6qgQFz+ WNDg== 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=dTAQGmi3QxdeaCrQeOk5rU6hPyZ9dCMkr+ILAF6Dryl2FVQ1PyEbT4chBjS2Kl2vJb JIE+CAWbxMhM1TlKYTj71bPZRpDI01vEWQd+k5RGxuiHuyvTYnxPOVJIfzmrrS2gKGqf kMnU6J747cqZHnd6+6W3yVbn7eBix+OxNpb6Xl64rl+0rL4vOf/hXOabIwvC6/TnbG5R D446Wg9XtIeqruiCfymXIZuGVKz5Rzss2x/PNI/270IRnu4ABAuvZLY5dZfu4PIwLJua x9IwRMfum7mqh8rU6vtvRPSmvgQtvg7TpHJC2ftVRfgAp5jZDrwwnawC3vTWbnviA53c 2Txg== X-Gm-Message-State: AOAM532X799hswo3yR7zMQKSyaKGHQ4jcdsB+R8dkts8GFrGrLMfmp6T fu2TEy31lxmUcW1dubLltlkumwzvOGU= X-Google-Smtp-Source: ABdhPJxHbxg7qbI189sDC60qPGSQ1ceglStBm1VmaHxX1ptxh+74Qv3TXD3quudiOJh34cpx8EEVBw== X-Received: by 2002:a05:6402:34c8:: with SMTP id w8mr11671382edc.194.1619617662774; Wed, 28 Apr 2021 06:47:42 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:42 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH v2 3/9] kernel-shark: Fix KS_DEFINE_PLUGIN_CONTEXT macro Date: Wed, 28 Apr 2021 16:47:24 +0300 Message-Id: <20210428134730.187533-4-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-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 Wed Apr 28 13:47: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: 12228895 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,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 E7765C43461 for ; Wed, 28 Apr 2021 13:47:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA9ED61158 for ; Wed, 28 Apr 2021 13:47:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239904AbhD1Nsd (ORCPT ); Wed, 28 Apr 2021 09:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234535AbhD1Nsa (ORCPT ); Wed, 28 Apr 2021 09:48:30 -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 01F7DC061342 for ; Wed, 28 Apr 2021 06:47:45 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id q6so15028143edr.3 for ; Wed, 28 Apr 2021 06:47:44 -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=stdNPv/pyxC7nT7tQP0ydAgWb6oYgZN23vCOEG8//SY=; b=mD8mnopRsaeSG/0a3SDfmfz8s//ZFobyrP1ls8zpCXPxO1IFApW3Q6wScqGgnn4nLw upb74yWKKXfUlAVmVkU3ilJFMVyMGvQB/hO9knd4lJnGsa4IxJ5tExn+/FZT3sjJthQJ OJkapfBTmjJyY0k2kc5/5RNNPcmxtiugmJxQB+ulpV4TbTWsdJ/Uk6jDdqyTFVoQfGJU EQWwPXXgIoiYXnutvMkUX6YDt8wPpnycnmj+qeZuPiPL3BFNubSt4Dk5VK5uYxW0nTDk NfOViTZsrfcKN5RRSBAXJpPyJLaWqOG66D+aeOtrSd3RgwL3cVVGJzusUAT64PIdcWui PDQw== 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=stdNPv/pyxC7nT7tQP0ydAgWb6oYgZN23vCOEG8//SY=; b=m7l7jbJsJOmyQMmqIh7vpsQXHuRe6LU0PYNhGuCinrcDFT1A2KnJczneiDPBcT5bB8 2BjJYII1SQRD6OWdLxo47wpTI5pzu50G8NbOdWv+qdCtqH1A7gP9PK9mUL0j1buN2bp5 BjFGHJUrRf50gKmpYegk5Ptmwh9rQ2E97ziIrpO8PmQD7vEbpfHJrsRM7wQN9uWhmTWJ gcXyolhFSCXJcqnntKmj5Lza1HktpNjyJpjbEwOfikhVxwhuLdVLHUSCY5n78tlsqUd3 wKluZYr48mTz7iSiiS9qUm2coIF+wUxi9+TKZIcftf4KlyvaW8XwrKzgr1RLBSyKbDRd JBZA== X-Gm-Message-State: AOAM53259NyFw08nyicrwrFiDXk6oDSv4dmsI5B74MGEvAlhUxPbix7T x1hK2LUuqaiP9pYU2dmhkph21R/amT0= X-Google-Smtp-Source: ABdhPJxq2QPhHQNbo1ogSiG8jTbeoYmmsmP2yxhu9VBoIG8ACwpe69W/QL3nmLbbVOt2d/v8vw2L7A== X-Received: by 2002:a05:6402:190d:: with SMTP id e13mr11352422edz.151.1619617663567; Wed, 28 Apr 2021 06:47:43 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:43 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH v2 4/9] kernel-shark: Add cleanup of all plugin contexts Date: Wed, 28 Apr 2021 16:47:25 +0300 Message-Id: <20210428134730.187533-5-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org 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 | 25 ++++++++++++++++--------- src/libkshark.h | 2 +- src/plugins/sched_events.c | 28 ++++++++++++++-------------- 4 files changed, 41 insertions(+), 24 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..b259b24 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. @@ -393,21 +396,25 @@ __hidden type *__init(int sd) \ __context_handler[sd] = obj; \ return obj; \ } \ +__hidden type *__get_context(int sd) \ +{ \ + if (sd < 0 || sd >= __n_streams) \ + return NULL; \ + return __context_handler[sd]; \ +} \ __hidden void __close(int sd) \ { \ - if (sd < 0) { \ + type *obj; \ + if (sd == KS_PLUGIN_CONTEXT_FREE) { \ free(__context_handler); \ __n_streams = -1; \ return; \ } \ - free(__context_handler[sd]); \ - __context_handler[sd] = NULL; \ -} \ -__hidden type *__get_context(int sd) \ -{ \ - if (sd < 0 || sd >= __n_streams) \ - return NULL; \ - return __context_handler[sd]; \ + obj = __get_context(sd); \ + if (obj) { \ + free(__context_handler[sd]); \ + __context_handler[sd] = NULL; \ + } \ } \ /** 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..f3c2c23 100644 --- a/src/plugins/sched_events.c +++ b/src/plugins/sched_events.c @@ -198,26 +198,26 @@ int KSHARK_PLOT_PLUGIN_INITIALIZER(struct kshark_data_stream *stream) int KSHARK_PLOT_PLUGIN_DEINITIALIZER(struct kshark_data_stream *stream) { printf("<-- sched close %i\n", stream->stream_id); - struct plugin_sched_context *plugin_ctx; - int sd = stream->stream_id; + struct plugin_sched_context *plugin_ctx = __get_context(stream->stream_id); + int ret = 0; - plugin_ctx = __get_context(sd); - if (!plugin_ctx) - return 0; + if (plugin_ctx) { + kshark_unregister_event_handler(stream, + plugin_ctx->sched_switch_event->id, + plugin_sched_swith_action); - kshark_unregister_event_handler(stream, - plugin_ctx->sched_switch_event->id, - plugin_sched_swith_action); + kshark_unregister_event_handler(stream, + plugin_ctx->sched_waking_event->id, + plugin_sched_wakeup_action); - kshark_unregister_event_handler(stream, - plugin_ctx->sched_waking_event->id, - plugin_sched_wakeup_action); + kshark_unregister_draw_handler(stream, plugin_draw); - kshark_unregister_draw_handler(stream, plugin_draw); + ret = 1; + } - __close(sd); + __close(stream->stream_id); - return 1; + return ret; } /** Initialize the control interface of the plugin. */ From patchwork Wed Apr 28 13:47: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: 12228901 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,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 7C9B0C43470 for ; Wed, 28 Apr 2021 13:47:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 666EE61158 for ; Wed, 28 Apr 2021 13:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239903AbhD1Nse (ORCPT ); Wed, 28 Apr 2021 09:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239912AbhD1Nsc (ORCPT ); Wed, 28 Apr 2021 09:48:32 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D62F1C061344 for ; Wed, 28 Apr 2021 06:47:45 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id j28so10290293edy.9 for ; Wed, 28 Apr 2021 06:47:45 -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=foydaeQupQGZAOnOFr5/fMaMck39gWKD2Snpovk8cyw=; b=cK6ABKurE50y6xy5MIF9oUqHm0/9+5X6Agbw+wkpYXb9Q64FR7BlRhNF0fFOsswBo8 y0n850p5F6AgS7q8eHtfFLYmLSe6FzKBgLHp80ag3eKx/yHj1H4q58eV49ez+yLWlszL 5XO13c9S7fEDP4FTz086MbiCWvwLq2VASYV5iD5jE4FiiXv4df1KJayw27a1RYmH1uqV iIstzeZjgc0jGsLDDqRRZQyS1v/tRQBTvhPvTti0vTp/7g4bq3pBTLJ1XHToBhgar7EU jkH26/6RZvj32r3cMODnZtx+T2rhmjvJV0hS6rW1jLnBIEuFXrsfV/Vu9SiSW0tYMPmo +NVw== 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=foydaeQupQGZAOnOFr5/fMaMck39gWKD2Snpovk8cyw=; b=Ehnztz2qVM5cpq13sKwVrdozd1XfsaF5kJcFkwzTMfga9OQaO7WQCqcwBB3J76QI8k e37eA5iNoxsQKRgeZRlH3WztSYWqpTSz3DAhYFcV8gmUQOLORLoT+u9C/3p/gyC8zuc8 yDxU0UduEZDm/z8kvL3YOUejwsPocydgh0n9yCjdzM0EpFhQEyIn9bNg4VxhpJuVKvkB jbIoZy9+VJkz1M8ZG0SOlGEFqqv8ixuX+rwKjsF5z0uTURA2TScpqXD5Wwzkd1J7w4b1 rRYKA3AmDVKtzuxzjTzGRAkGZN2Vb+mQfnJ3w0VcU0HPukelp4du2Wg7sE91v9kWjqFR 6nTw== X-Gm-Message-State: AOAM532NVbDK00+MrS7ZvQkl3WwUivwMqfL0ay0u3JVi69BfCvRggW3V O+pQtwyvN73lXYyYx74cz95tpEHeIEs= X-Google-Smtp-Source: ABdhPJx2FO1zYt8mh1742HDAXyCR73PbomBf6rs9L335Xxt5iAqtfAcI29f03KiJq4g+56Xe+xaAdg== X-Received: by 2002:a05:6402:1a58:: with SMTP id bf24mr11644828edb.231.1619617664392; Wed, 28 Apr 2021 06:47:44 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:44 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH v2 5/9] kernel-shark: Fix memory leak in "sched events" plugin. Date: Wed, 28 Apr 2021 16:47:26 +0300 Message-Id: <20210428134730.187533-6-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-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 | 11 ++++++++++- tests/libkshark-tests.cpp | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libkshark-plugin.h b/src/libkshark-plugin.h index b259b24..10e5f1b 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) \ @@ -412,7 +412,7 @@ __hidden void __close(int sd) \ } \ obj = __get_context(sd); \ if (obj) { \ - free(__context_handler[sd]); \ + type_free(__context_handler[sd]); \ __context_handler[sd] = NULL; \ } \ } \ diff --git a/src/plugins/sched_events.c b/src/plugins/sched_events.c index f3c2c23..e151a70 100644 --- a/src/plugins/sched_events.c +++ b/src/plugins/sched_events.c @@ -73,8 +73,17 @@ 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; + + kshark_free_data_container(plugin_ctx->ss_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 Wed Apr 28 13:47:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12228897 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,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 C01AFC43600 for ; Wed, 28 Apr 2021 13:47:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F74661158 for ; Wed, 28 Apr 2021 13:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239912AbhD1Nse (ORCPT ); Wed, 28 Apr 2021 09:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239914AbhD1Nsc (ORCPT ); Wed, 28 Apr 2021 09:48:32 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB9D6C061345 for ; Wed, 28 Apr 2021 06:47:46 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id z5so37804534edr.11 for ; Wed, 28 Apr 2021 06:47: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=wDoYhbKqi7r7+XeFLpvtcL7WyvNxB0XsH3vwGXpVVCs=; b=NjQtJP8g1yPK74GrD1PzObxBZsx/h5n6EyLXdTIm5t/2vCdq5m0BurH9P3B5sNZDiM sSNrLdblnw7IuDS1yLncj/+SuvFxLtD4wxDANM8A7H7vzElu+8FH76k7ewEQvuwG6DRV 3Usophpl5WvlJPgNqwVLlVOxde1C1t00MhZQEr/fVMYew15720u5qm7Tg3pWJbKWT56R PoMHykWgMyJNWTrv9GtRog/NboSlKLkKl6tCLi8fnMsGO/DGvHLLnXfSOMEz/jmDiGLc ZrcGrai9k8OW3f29Nux1fp9GgE24MHyS9yGdTMDGxfN4q4d1dZF3E7ygzxdMUTT3M2K5 w5Ig== 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=B8/7W7kpWXBvz4yocm+eCGH5fbnS3ZV4poj7KdwCMMQe5D3TqwRlcW1ochyHZjEe4o LQIeEohSWYdxhTecVUiTyn/tivUeaQmyPt1DlkWdugoycONU2evi2luou1FrNhkgCanT iVATo42ExAMStZCGkv/WzChZ/whvtaFVu/WMzNEPhad5buRmfwN5bR+G0T/MXj1PTzMW TiqNIxLD8bl182K0a9JyR5dnWx4cX8XsLVlhPZl1eqgAQPesluPJ/29OERVoTtT1suFs bJqgKcYDWiztTu9pejqF+XYNafzG8c/gy5Q3XdGVwvrcKWjkx+UPvtPrMtQ9Hqi+Pw6i sebg== X-Gm-Message-State: AOAM5313Ntybbf6Ttde9SnGo0bUGEBb2wHPqDkprgNI/vSyt2wQxATCy LUooGKbqmKXyPzdOdtHNZ0FpeUP2vH0= X-Google-Smtp-Source: ABdhPJz5iKK9mQHGryfB/6hfUeZ/lQCNrAhcDpAnKWn8s1N1G1nfW4G+qdpHh0N/JjHPL3g6GMFO8g== X-Received: by 2002:aa7:d705:: with SMTP id t5mr3258349edq.141.1619617665181; Wed, 28 Apr 2021 06:47:45 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:44 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH v2 6/9] kernel-shark: Disable the pop-up offset dialog Date: Wed, 28 Apr 2021 16:47:27 +0300 Message-Id: <20210428134730.187533-7-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-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 Wed Apr 28 13:47:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12228893 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,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 60853C43462 for ; Wed, 28 Apr 2021 13:47:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3703F61444 for ; Wed, 28 Apr 2021 13:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239909AbhD1Nse (ORCPT ); Wed, 28 Apr 2021 09:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239903AbhD1Nsc (ORCPT ); Wed, 28 Apr 2021 09:48:32 -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 8C875C06138A for ; Wed, 28 Apr 2021 06:47:47 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id j28so10290415edy.9 for ; Wed, 28 Apr 2021 06:47:47 -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=ruoAXmvgM9h5z+W3T58loi97Q28jHWKMvrrVd7NyfNjg+lkwb8ep8jpSUZyzO/P0n2 hxUp2pViS9JEG2AauizDUutbUO8762vJrQaRWjN1QQXZ1AedMtTaicwHOO5uyIs2E41f KlqHyPVZt9oUTVfvGg+l3pBEOHRQPqJy0CS21IWbXNvJq47FRGqrT4JX+Ffn7awGZsiQ 5Gfbdwea1WdcDfxvk0PeIpYnHcTytzNYTD/b7UauAIRNYynQxgDpE8no/HdEobGxT9xe bhWmgC0Sv7RAmGP5yKIioUJ6vaoZpKPYUms/J6d3YFZemt383TAd1GvcyxALlQqUEogM YoQQ== 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=TwZDRv2w2F6KKA/jeoGCpkydiukBiZLswCK42UKFfiqE1aUkvlWItbl4Cb+ej9aU9C wBS5h3sDnEhfyV/yECGcxYpfTDnEqqXfRDMXRH4R6R+QlZXgiZux3AesebKrFKI7It39 v85lCDhRzvgeeUFUpTtHpr91DU4Aa6dWj8a4s8fxnf9kRDEdHl9jpEmf9DCmOo2uIzNo e2BPbLo4ulEFTgLU2UbJSBAkKMmE+SO1/KifdxvxPmXGS4uNDdxLgxXBUC/qGpYBeoqD om+V8c3PPNDvxLYxw6isaqLU+bGoR7Oj9EqViBxNFWndIDunB7YSrhxWLviaYBCGalFB jfxQ== X-Gm-Message-State: AOAM532xh5ipp5sP2qjwSVjxfh3FpDmTVoBvwKk9yj/wxw9wsTp8jnLu TZVJrkN0VLd7Xcqb4OwzdLZnoiEorq4= X-Google-Smtp-Source: ABdhPJzmk78xDRj+gtVSydxneNO6dJbX8ihquJLYtgCF+oZjOigN1/bVUFfXB5EKHvSt14pWMwE9QA== X-Received: by 2002:a05:6402:37a:: with SMTP id s26mr11500166edw.159.1619617666166; Wed, 28 Apr 2021 06:47:46 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:45 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH v2 7/9] kernel-shark: Remove kvm_combo from the list of default plugins Date: Wed, 28 Apr 2021 16:47:28 +0300 Message-Id: <20210428134730.187533-8-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-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", }; /** From patchwork Wed Apr 28 13:47:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12228905 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,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 7F608C433ED for ; Wed, 28 Apr 2021 13:47:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4331661158 for ; Wed, 28 Apr 2021 13:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239917AbhD1Nsf (ORCPT ); Wed, 28 Apr 2021 09:48:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbhD1Nsd (ORCPT ); Wed, 28 Apr 2021 09:48:33 -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 6404AC06138B for ; Wed, 28 Apr 2021 06:47:48 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id d14so10478430edc.12 for ; Wed, 28 Apr 2021 06:47:48 -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=0z89Or18S3fMIPn49h/dWPO7Hpy/HGngH6D0T3cQQYc=; b=F67XPhRb4ElMbk0grxXfkkfyhT2iR6iBkpZRTASOaUUkDLh2iXnKmnlKYU88yUQy9W nLry0eyuBEGU+J9Myce58vmREUoeDljl7dg/+cdoWBz7EiAl7MTJ9dk8rCUpNHKd9JgW xfOcAn7/sfFzS30KHaA6qgZL5PEbR76uijLKWQ8aQvVZq8CxYE06fu3rK3OOtVnXamah UO0kIJ232rc1uNfXP9NpqW4QqnY2+xUQvGRoB0axmDNRfWwlKyT885dwRH0+hzKlYGmc V2Hmo/gkpkRFzmOXa36XiOe8nXdtRTIIT5DLZnc7tZb234Ohfd/Dl6sUjcAXli3zhOe7 XDSQ== 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=0z89Or18S3fMIPn49h/dWPO7Hpy/HGngH6D0T3cQQYc=; b=UIFqxwVgAMiUt+csvGse3s/mVY7RpTMnyTHwvcHok24JEpJOmjOX9bY4jSuWD04pxI xMJevOkEsCGOahIJ7jN+cfgL+bB2L8zlfs9lYqhTuEhdLr4ES8q3a+YhhTqTrshT+gH1 DivZCH7ruM/o8qda1PNm76cbAXJ+UcKBy6gtnEyWrYiWDWup+yR/r0H+F2LJsDF63x7c VoWTI3csA9NkrNDlQE3R61BcP3TOOXSOz1p+hFeFVDbckzTuiRy1az2On1s3IxoyH+iN 0IJ+hbMvV2dulIAZkewl6GGJZUNvV36A6r2xEBqYXRqHULMwbsnoWQ/62VUE/JnJySYx xUEg== X-Gm-Message-State: AOAM5334JRvwKDXMR7ee4DR3egOfseK8TS2Jf1aeSNdoTdHrHbM99bzp JhPiIYrkDwxAKEfMZZoQyYYrhguAQWM= X-Google-Smtp-Source: ABdhPJytTVy6i8EJQstW1SezvCNnB1Qnaz8R3x/UKhWYRFdtygLTSqBb80uc8dndHXffMtKqwTM8Bw== X-Received: by 2002:aa7:c2cc:: with SMTP id m12mr11338624edp.1.1619617667005; Wed, 28 Apr 2021 06:47:47 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:46 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH v2 8/9] kernel-shark: Remove debugging print out from plugins Date: Wed, 28 Apr 2021 16:47:29 +0300 Message-Id: <20210428134730.187533-9-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org We remove the print out that indicates when the "sched events" and "missed events" plugins are initialized and closed. Signed-off-by: Yordan Karadzhov (VMware) --- src/plugins/missed_events.c | 2 -- src/plugins/sched_events.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/src/plugins/missed_events.c b/src/plugins/missed_events.c index 8fe9780..8109eb8 100644 --- a/src/plugins/missed_events.c +++ b/src/plugins/missed_events.c @@ -20,7 +20,6 @@ /** Load this plugin. */ int KSHARK_PLOT_PLUGIN_INITIALIZER(struct kshark_data_stream *stream) { - printf("--> missed_events init %i\n", stream->stream_id); kshark_register_draw_handler(stream, draw_missed_events); return 1; @@ -29,7 +28,6 @@ int KSHARK_PLOT_PLUGIN_INITIALIZER(struct kshark_data_stream *stream) /** Unload this plugin. */ int KSHARK_PLOT_PLUGIN_DEINITIALIZER(struct kshark_data_stream *stream) { - printf("<-- missed_events close %i\n", stream->stream_id); kshark_unregister_draw_handler(stream, draw_missed_events); return 1; diff --git a/src/plugins/sched_events.c b/src/plugins/sched_events.c index e151a70..64dff8d 100644 --- a/src/plugins/sched_events.c +++ b/src/plugins/sched_events.c @@ -181,7 +181,6 @@ static void plugin_sched_wakeup_action(struct kshark_data_stream *stream, /** Load this plugin. */ int KSHARK_PLOT_PLUGIN_INITIALIZER(struct kshark_data_stream *stream) { - printf("--> sched init %i\n", stream->stream_id); struct plugin_sched_context *plugin_ctx; plugin_ctx = __init(stream->stream_id); @@ -206,7 +205,6 @@ int KSHARK_PLOT_PLUGIN_INITIALIZER(struct kshark_data_stream *stream) /** Unload this plugin. */ int KSHARK_PLOT_PLUGIN_DEINITIALIZER(struct kshark_data_stream *stream) { - printf("<-- sched close %i\n", stream->stream_id); struct plugin_sched_context *plugin_ctx = __get_context(stream->stream_id); int ret = 0; @@ -232,6 +230,5 @@ int KSHARK_PLOT_PLUGIN_DEINITIALIZER(struct kshark_data_stream *stream) /** Initialize the control interface of the plugin. */ void *KSHARK_MENU_PLUGIN_INITIALIZER(void *gui_ptr) { - printf("--> sched init menu\n"); return plugin_set_gui_ptr(gui_ptr); } From patchwork Wed Apr 28 13:47:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 12228903 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,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 AF379C433B4 for ; Wed, 28 Apr 2021 13:47:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 763096143A for ; Wed, 28 Apr 2021 13:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbhD1Nsf (ORCPT ); Wed, 28 Apr 2021 09:48:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234535AbhD1Nse (ORCPT ); Wed, 28 Apr 2021 09:48:34 -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 10290C061574 for ; Wed, 28 Apr 2021 06:47:49 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id g10so6355578edb.0 for ; Wed, 28 Apr 2021 06:47:48 -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=3r8eNFkztcMlCX8qzMWGg+VALgmQ4KRwk/KbIF3CT6A=; b=shs+gEzBtaWmM21h8xFh8RKT8Bao192VPcWUkKSJPWKOZKLfSeSVG8YNzWjXqDJ+4L d61J5/lIUzdtFkV5+dQVAL6ONK6HuUs820D6Euq3yaWsf+SEF47jG4G9/YZXywwWU584 lK0wOoeUAwrIJ8TiM/AmWiDp9dsomW6JatpaCk4xbMpiqVuN3PG3pwp5BMLt/iEzcjI/ agnDGXtDSQKmmuCMis6rTORDFwEhLJnDmO/f1E3xd43FCghXPEaHdeOi9qt1UbqJI8sf vMiiZ9j13aFDXOrUmcCubaltSvTiEXkVXhqiUgojzSb5sJQT7jVsc9+01MAEGrMjbrxf JaMQ== 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=3r8eNFkztcMlCX8qzMWGg+VALgmQ4KRwk/KbIF3CT6A=; b=r1MPxSmyo+4fwfR2bGbae0pdivMLxci7RYMSAHdB1WlFUFRbthuxPVJ8mrejUlkmDI /LgJ2p4fCB395vWvJnkFoMSYkkf9rQ5FtxS+r1EIsxK53tGymb/qskLj4ADvOv4Q2d9f 84llPliYzqQGWFLlXqJCPvKYjusKvz66UgvfnV1DUJz3ODlguyJ5U7MmZFignZPPzSPP fZhKeWhfTUYDmkCc0MYTZDUEyc+QT0x2/RC72OUcuVZhFFCRVhnvIgOgwbMT0nJEknAu Me1zrQkNOVgrzuPhdwsazjni924rMtDNJwERF3jir990dJhgHNiaWk3ClGjR8rUSJgz1 Y3FQ== X-Gm-Message-State: AOAM533GJnfX5pCcVyyCu6+o7h2/BRdWJqsVGQjWavS8RPn98Wtlcb5h FGvfCpWw25P+yhLdNXPIca6Q4mu7taA= X-Google-Smtp-Source: ABdhPJyZ5gMEL7Ppt3ty4ZQvfL5eWbJ2m7Ch3qZyenT8QhxDuSY+sNYGcf8at6q2l4JvDwm1HOq1Ag== X-Received: by 2002:aa7:d594:: with SMTP id r20mr2988311edq.242.1619617667681; Wed, 28 Apr 2021 06:47:47 -0700 (PDT) Received: from localhost.localdomain ([84.40.73.176]) by smtp.gmail.com with ESMTPSA id y6sm4755952edc.26.2021.04.28.06.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 06:47:47 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: linux-trace-devel@vger.kernel.org Cc: "Yordan Karadzhov (VMware)" Subject: [PATCH v2 9/9] kernel-shark: Hide all plugin internals Date: Wed, 28 Apr 2021 16:47:30 +0300 Message-Id: <20210428134730.187533-10-y.karadz@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210428134730.187533-1-y.karadz@gmail.com> References: <20210428134730.187533-1-y.karadz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Nothing except the plugin's interface must be visible outside. Signed-off-by: Yordan Karadzhov (VMware) --- src/plugins/MissedEvents.cpp | 2 +- src/plugins/SchedEvents.cpp | 5 +++-- src/plugins/sched_events.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/MissedEvents.cpp b/src/plugins/MissedEvents.cpp index cf0ed34..fdd47c8 100644 --- a/src/plugins/MissedEvents.cpp +++ b/src/plugins/MissedEvents.cpp @@ -89,7 +89,7 @@ static PlotObject *makeShape(std::vector graph, * @param val: Process or CPU Id value. * @param draw_action: Draw action identifier. */ -void draw_missed_events(kshark_cpp_argv *argv_c, +__hidden void draw_missed_events(kshark_cpp_argv *argv_c, int sd, int val, int draw_action) { KsCppArgV *argvCpp = KS_ARGV_TO_CPP(argv_c); diff --git a/src/plugins/SchedEvents.cpp b/src/plugins/SchedEvents.cpp index a81182e..b73e45f 100644 --- a/src/plugins/SchedEvents.cpp +++ b/src/plugins/SchedEvents.cpp @@ -30,7 +30,7 @@ static KsMainWindow *ks_ptr; * @brief Provide the plugin with a pointer to the KsMainWindow object (the GUI * itself) such that the plugin can manipulate the GUI. */ -void *plugin_set_gui_ptr(void *gui_ptr) +__hidden void *plugin_set_gui_ptr(void *gui_ptr) { ks_ptr = static_cast(gui_ptr); return nullptr; @@ -152,7 +152,8 @@ static void secondPass(plugin_sched_context *plugin_ctx) * @param pid: Process Id. * @param draw_action: Draw action identifier. */ -void plugin_draw(kshark_cpp_argv *argv_c, int sd, int pid, int draw_action) +__hidden void plugin_draw(kshark_cpp_argv *argv_c, + int sd, int pid, int draw_action) { plugin_sched_context *plugin_ctx; diff --git a/src/plugins/sched_events.c b/src/plugins/sched_events.c index 64dff8d..659ecc3 100644 --- a/src/plugins/sched_events.c +++ b/src/plugins/sched_events.c @@ -47,7 +47,7 @@ static void plugin_sched_set_pid(ks_num_field_t *field, * * @param field: Input location for the data field. */ -int plugin_sched_get_pid(ks_num_field_t field) +__hidden int plugin_sched_get_pid(ks_num_field_t field) { return field & PID_MASK; } @@ -67,7 +67,7 @@ static void plugin_sched_set_prev_state(ks_num_field_t *field, * * @param field: Input location for the data field. */ -int plugin_sched_get_prev_state(ks_num_field_t field) +__hidden int plugin_sched_get_prev_state(ks_num_field_t field) { tep_num_field_t mask = PREV_STATE_MASK << PREV_STATE_SHIFT; return (field & mask) >> PREV_STATE_SHIFT;