From patchwork Mon Feb 11 01:18:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 10805015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D000E746 for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBC8F297FD for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADD552980F; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16FDE2980F for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726358AbfBKBVz (ORCPT ); Sun, 10 Feb 2019 20:21:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:49420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbfBKBVz (ORCPT ); Sun, 10 Feb 2019 20:21:55 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B7F77214DA; Mon, 11 Feb 2019 01:21:54 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92-RC5) (envelope-from ) id 1gt0ID-0003w4-Un; Sun, 10 Feb 2019 20:21:53 -0500 Message-Id: <20190211012153.848572065@goodmis.org> User-Agent: quilt/0.65 Date: Sun, 10 Feb 2019 20:18:08 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 1/4] kernel-shark: Remove testing of "success" field of wakeup events References: <20190211011807.714634783@goodmis.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Steven Rostedt (VMware)" Since 2011 (or Linux version 3.0) the sched wakeup event "success" field has been hardcoded to true (or 1). There's no reason to waste cycles checking it in any newer kernel, which is most of them. Just ignore it. Even when running on older kernels which may have a success=0 value, the algorithm should still work. Signed-off-by: Steven Rostedt (VMware) --- kernel-shark/src/plugins/sched_events.c | 25 +++---------------------- kernel-shark/src/plugins/sched_events.h | 8 -------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/kernel-shark/src/plugins/sched_events.c b/kernel-shark/src/plugins/sched_events.c index c0328e804911..5b1af7722624 100644 --- a/kernel-shark/src/plugins/sched_events.c +++ b/kernel-shark/src/plugins/sched_events.c @@ -68,9 +68,6 @@ static bool plugin_sched_init_context(struct kshark_context *kshark_ctx) plugin_ctx->sched_wakeup_pid_field = tep_find_any_field(event, "pid"); - plugin_ctx->sched_wakeup_success_field = - tep_find_field(event, "success"); - event = tep_find_event_by_name(plugin_ctx->pevent, "sched", "sched_wakeup_new"); if (!event) @@ -80,9 +77,6 @@ static bool plugin_sched_init_context(struct kshark_context *kshark_ctx) plugin_ctx->sched_wakeup_new_pid_field = tep_find_any_field(event, "pid"); - plugin_ctx->sched_wakeup_new_success_field = - tep_find_field(event, "success"); - plugin_ctx->second_pass_hash = tracecmd_filter_id_hash_alloc(); return true; @@ -175,8 +169,7 @@ bool plugin_wakeup_match_rec_pid(struct kshark_context *kshark_ctx, { struct plugin_sched_context *plugin_ctx; struct tep_record *record = NULL; - unsigned long long val; - int ret, wakeup_pid = -1; + int wakeup_pid = -1; plugin_ctx = plugin_sched_context_handler; if (!plugin_ctx) @@ -185,25 +178,13 @@ bool plugin_wakeup_match_rec_pid(struct kshark_context *kshark_ctx, if (plugin_ctx->sched_wakeup_event && e->event_id == plugin_ctx->sched_wakeup_event->id) { record = tracecmd_read_at(kshark_ctx->handle, e->offset, NULL); - - /* We only want those that actually woke up the task. */ - ret = tep_read_number_field(plugin_ctx->sched_wakeup_success_field, - record->data, &val); - - if (ret == 0 && val) - wakeup_pid = plugin_get_rec_wakeup_pid(record); + wakeup_pid = plugin_get_rec_wakeup_pid(record); } if (plugin_ctx->sched_wakeup_new_event && e->event_id == plugin_ctx->sched_wakeup_new_event->id) { record = tracecmd_read_at(kshark_ctx->handle, e->offset, NULL); - - /* We only want those that actually woke up the task. */ - ret = tep_read_number_field(plugin_ctx->sched_wakeup_new_success_field, - record->data, &val); - - if (ret == 0 && val) - wakeup_pid = plugin_get_rec_wakeup_new_pid(record); + wakeup_pid = plugin_get_rec_wakeup_new_pid(record); } free_record(record); diff --git a/kernel-shark/src/plugins/sched_events.h b/kernel-shark/src/plugins/sched_events.h index fb1849ee8ffb..0beb63fe2b48 100644 --- a/kernel-shark/src/plugins/sched_events.h +++ b/kernel-shark/src/plugins/sched_events.h @@ -45,20 +45,12 @@ struct plugin_sched_context { /** Pointer to the sched_wakeup_pid_field format descriptor. */ struct tep_format_field *sched_wakeup_pid_field; - /** Pointer to the sched_wakeup_success_field format descriptor. */ - struct tep_format_field *sched_wakeup_success_field; - /** Pointer to the sched_wakeup_new_event object. */ struct tep_event *sched_wakeup_new_event; /** Pointer to the sched_wakeup_new_pid_field format descriptor. */ struct tep_format_field *sched_wakeup_new_pid_field; - /** - * Pointer to the sched_wakeup_new_success_field format descriptor. - */ - struct tep_format_field *sched_wakeup_new_success_field; - /** List of Data collections used by this plugin. */ struct kshark_entry_collection *collections; From patchwork Mon Feb 11 01:18:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 10805017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C95F13B5 for ; Mon, 11 Feb 2019 01:21:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C326297FC for ; Mon, 11 Feb 2019 01:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2064C2980F; Mon, 11 Feb 2019 01:21:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2005297FC for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726231AbfBKBV4 (ORCPT ); Sun, 10 Feb 2019 20:21:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:49430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbfBKBV4 (ORCPT ); Sun, 10 Feb 2019 20:21:56 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E708521736; Mon, 11 Feb 2019 01:21:54 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92-RC5) (envelope-from ) id 1gt0IE-0003wY-34; Sun, 10 Feb 2019 20:21:54 -0500 Message-Id: <20190211012153.982548008@goodmis.org> User-Agent: quilt/0.65 Date: Sun, 10 Feb 2019 20:18:09 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 2/4] kernel-shark: Consolidate duplicate code of the sched_wakeup events References: <20190211011807.714634783@goodmis.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Steven Rostedt (VMware)" The logic used for sched_wakeup and sched_wakeup_new events are basically the same. Create helper functions to be called to do the duplicate code with just passing in the parameters that are unique to the events. Signed-off-by: Steven Rostedt (VMware) Reviewed-by: Yordan Karadzhov --- kernel-shark/src/plugins/sched_events.c | 106 +++++++++++++++--------- 1 file changed, 66 insertions(+), 40 deletions(-) diff --git a/kernel-shark/src/plugins/sched_events.c b/kernel-shark/src/plugins/sched_events.c index 5b1af7722624..0f5c08e3508d 100644 --- a/kernel-shark/src/plugins/sched_events.c +++ b/kernel-shark/src/plugins/sched_events.c @@ -23,10 +23,27 @@ /** Plugin context instance. */ struct plugin_sched_context *plugin_sched_context_handler = NULL; +static bool define_wakeup_event(struct tep_handle *tep, const char *wakeup_name, + struct tep_event **wakeup_event, + struct tep_format_field **pid_field) +{ + struct tep_event *event; + + event = tep_find_event_by_name(tep, "sched", wakeup_name); + if (!event) + return false; + + *wakeup_event = event; + *pid_field = tep_find_any_field(event, "pid"); + + return true; +} + static bool plugin_sched_init_context(struct kshark_context *kshark_ctx) { struct plugin_sched_context *plugin_ctx; struct tep_event *event; + bool wakeup_found; /* No context should exist when we initialize the plugin. */ assert(plugin_sched_context_handler == NULL); @@ -59,23 +76,17 @@ static bool plugin_sched_init_context(struct kshark_context *kshark_ctx) plugin_ctx->sched_switch_prev_state_field = tep_find_field(event, "prev_state"); - event = tep_find_event_by_name(plugin_ctx->pevent, - "sched", "sched_wakeup"); - if (!event) - return false; - plugin_ctx->sched_wakeup_event = event; - plugin_ctx->sched_wakeup_pid_field = - tep_find_any_field(event, "pid"); + wakeup_found = define_wakeup_event(kshark_ctx->pevent, "sched_wakeup", + &plugin_ctx->sched_wakeup_event, + &plugin_ctx->sched_wakeup_pid_field); - event = tep_find_event_by_name(plugin_ctx->pevent, - "sched", "sched_wakeup_new"); - if (!event) - return false; + wakeup_found |= define_wakeup_event(kshark_ctx->pevent, "sched_wakeup_new", + &plugin_ctx->sched_wakeup_new_event, + &plugin_ctx->sched_wakeup_new_pid_field); - plugin_ctx->sched_wakeup_new_event = event; - plugin_ctx->sched_wakeup_new_pid_field = - tep_find_any_field(event, "pid"); + if (!wakeup_found) + return false; plugin_ctx->second_pass_hash = tracecmd_filter_id_hash_alloc(); @@ -139,17 +150,51 @@ static void plugin_register_command(struct kshark_context *kshark_ctx, tep_register_comm(kshark_ctx->pevent, comm, pid); } -static int plugin_get_rec_wakeup_new_pid(struct tep_record *record) +int find_wakeup_pid(struct kshark_context *kshark_ctx, struct kshark_entry *e, + struct tep_event *wakeup_event, struct tep_format_field *pid_field) { - struct plugin_sched_context *plugin_ctx = - plugin_sched_context_handler; + struct tep_record *record; unsigned long long val; int ret; - ret = tep_read_number_field(plugin_ctx->sched_wakeup_new_pid_field, - record->data, &val); + if (!wakeup_event || e->event_id != wakeup_event->id) + return -1; - return ret ? : val; + record = tracecmd_read_at(kshark_ctx->handle, e->offset, NULL); + ret = tep_read_number_field(pid_field, record->data, &val); + free_record(record); + + if (ret) + return -1; + + return val; +} + +static bool wakeup_match_rec_pid(struct plugin_sched_context *plugin_ctx, + struct kshark_context *kshark_ctx, + struct kshark_entry *e, + int pid) +{ + struct tep_event *wakeup_events[] = { + plugin_ctx->sched_wakeup_event, + plugin_ctx->sched_wakeup_new_event, + }; + struct tep_format_field *wakeup_fields[] = { + plugin_ctx->sched_wakeup_pid_field, + plugin_ctx->sched_wakeup_new_pid_field, + }; + int i, wakeup_pid = -1; + + for (i = 0; i < sizeof(wakeup_events) / sizeof(wakeup_events[0]); i++) { + wakeup_pid = find_wakeup_pid(kshark_ctx, e, wakeup_events[i], wakeup_fields[i]); + if (wakeup_pid >= 0) + break; + } + + if (wakeup_pid >= 0 && wakeup_pid == pid) + return true; + + return false; } /** @@ -168,31 +213,12 @@ bool plugin_wakeup_match_rec_pid(struct kshark_context *kshark_ctx, int pid) { struct plugin_sched_context *plugin_ctx; - struct tep_record *record = NULL; - int wakeup_pid = -1; plugin_ctx = plugin_sched_context_handler; if (!plugin_ctx) return false; - if (plugin_ctx->sched_wakeup_event && - e->event_id == plugin_ctx->sched_wakeup_event->id) { - record = tracecmd_read_at(kshark_ctx->handle, e->offset, NULL); - wakeup_pid = plugin_get_rec_wakeup_pid(record); - } - - if (plugin_ctx->sched_wakeup_new_event && - e->event_id == plugin_ctx->sched_wakeup_new_event->id) { - record = tracecmd_read_at(kshark_ctx->handle, e->offset, NULL); - wakeup_pid = plugin_get_rec_wakeup_new_pid(record); - } - - free_record(record); - - if (wakeup_pid >= 0 && wakeup_pid == pid) - return true; - - return false; + return wakeup_match_rec_pid(plugin_ctx, kshark_ctx, e, pid); } /** From patchwork Mon Feb 11 01:18:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 10805009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8705D17E6 for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76803297FC for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 587AC29811; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0C22297FD for ; Mon, 11 Feb 2019 01:21:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726032AbfBKBVz (ORCPT ); Sun, 10 Feb 2019 20:21:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:49448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfBKBVz (ORCPT ); Sun, 10 Feb 2019 20:21:55 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 14B592173C; Mon, 11 Feb 2019 01:21:55 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92-RC5) (envelope-from ) id 1gt0IE-0003x2-7c; Sun, 10 Feb 2019 20:21:54 -0500 Message-Id: <20190211012154.123854384@goodmis.org> User-Agent: quilt/0.65 Date: Sun, 10 Feb 2019 20:18:10 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 3/4] kernel-shark: Remove plugin_get_rec_wakeup_pid() References: <20190211011807.714634783@goodmis.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Steven Rostedt (VMware)" The function plugin_get_rec_wakeup_pid() is not used by anything. Remove it. Signed-off-by: Steven Rostedt (VMware) --- kernel-shark/src/plugins/sched_events.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/kernel-shark/src/plugins/sched_events.c b/kernel-shark/src/plugins/sched_events.c index 0f5c08e3508d..0cfe5b5367e2 100644 --- a/kernel-shark/src/plugins/sched_events.c +++ b/kernel-shark/src/plugins/sched_events.c @@ -111,24 +111,6 @@ int plugin_get_next_pid(struct tep_record *record) return ret ? : val; } -/** - * @brief Get the Process Id of the task being woke up. - * - * @param record: Input location for a sched_wakeup record. - */ -int plugin_get_rec_wakeup_pid(struct tep_record *record) -{ - struct plugin_sched_context *plugin_ctx = - plugin_sched_context_handler; - unsigned long long val; - int ret; - - ret = tep_read_number_field(plugin_ctx->sched_wakeup_pid_field, - record->data, &val); - - return ret ? : val; -} - static void plugin_register_command(struct kshark_context *kshark_ctx, struct tep_record *record, int pid) From patchwork Mon Feb 11 01:18:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 10805013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D73DF188D for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4EC929813 for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6D6929811; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 399E229810 for ; Mon, 11 Feb 2019 01:21:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726154AbfBKBV4 (ORCPT ); Sun, 10 Feb 2019 20:21:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:49462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbfBKBV4 (ORCPT ); Sun, 10 Feb 2019 20:21:56 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3980A2176F; Mon, 11 Feb 2019 01:21:55 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.92-RC5) (envelope-from ) id 1gt0IE-0003xW-Bw; Sun, 10 Feb 2019 20:21:54 -0500 Message-Id: <20190211012154.262506802@goodmis.org> User-Agent: quilt/0.65 Date: Sun, 10 Feb 2019 20:18:11 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: Yordan Karadzhov Subject: [PATCH 4/4] kernel-shark: Add sched_waking event processing to sched_waking References: <20190211011807.714634783@goodmis.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Steven Rostedt (VMware)" It is now more common to enable the sched_waking event than to use the sched_wakeup or sched_wakeup_new, as it encompasses both. But the sched plugin does not handle that. Fix that by including the sched_waking event as an event to use for processing schedule wakeup events. Signen-off-by: Steven Rostedt (VMware) --- kernel-shark/src/plugins/sched_events.c | 6 ++++++ kernel-shark/src/plugins/sched_events.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/kernel-shark/src/plugins/sched_events.c b/kernel-shark/src/plugins/sched_events.c index 0cfe5b5367e2..14f8edb2836b 100644 --- a/kernel-shark/src/plugins/sched_events.c +++ b/kernel-shark/src/plugins/sched_events.c @@ -85,6 +85,10 @@ static bool plugin_sched_init_context(struct kshark_context *kshark_ctx) &plugin_ctx->sched_wakeup_new_event, &plugin_ctx->sched_wakeup_new_pid_field); + wakeup_found |= define_wakeup_event(kshark_ctx->pevent, "sched_waking", + &plugin_ctx->sched_waking_event, + &plugin_ctx->sched_waking_pid_field); + if (!wakeup_found) return false; @@ -158,10 +162,12 @@ static bool wakeup_match_rec_pid(struct plugin_sched_context *plugin_ctx, int pid) { struct tep_event *wakeup_events[] = { + plugin_ctx->sched_waking_event, plugin_ctx->sched_wakeup_event, plugin_ctx->sched_wakeup_new_event, }; struct tep_format_field *wakeup_fields[] = { + plugin_ctx->sched_waking_pid_field, plugin_ctx->sched_wakeup_pid_field, plugin_ctx->sched_wakeup_new_pid_field, }; diff --git a/kernel-shark/src/plugins/sched_events.h b/kernel-shark/src/plugins/sched_events.h index 0beb63fe2b48..dbc9963cbc4e 100644 --- a/kernel-shark/src/plugins/sched_events.h +++ b/kernel-shark/src/plugins/sched_events.h @@ -51,6 +51,12 @@ struct plugin_sched_context { /** Pointer to the sched_wakeup_new_pid_field format descriptor. */ struct tep_format_field *sched_wakeup_new_pid_field; + /** Pointer to the sched_waking_event object. */ + struct tep_event *sched_waking_event; + + /** Pointer to the sched_waking_pid_field format descriptor. */ + struct tep_format_field *sched_waking_pid_field; + /** List of Data collections used by this plugin. */ struct kshark_entry_collection *collections;