From patchwork Wed Jul 11 13:37:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10758657 Return-Path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:39985 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387878AbeGKNmE (ORCPT ); Wed, 11 Jul 2018 09:42:04 -0400 Received: by mail-wm0-f66.google.com with SMTP id z13-v6so2592911wma.5 for ; Wed, 11 Jul 2018 06:37:40 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 1/2] kernel-shark-qt: Deal with the "no tasks" case in kshark_get_task_pids() Date: Wed, 11 Jul 2018 16:37:08 +0300 Message-Id: <20180711133709.26788-1-y.karadz@gmail.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: kshark_get_task_pids() should not return a "memory allocation" error in the case when it is called before having trace data loaded. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark-qt/src/libkshark.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c index 668b6df..75b88c9 100644 --- a/kernel-shark-qt/src/libkshark.c +++ b/kernel-shark-qt/src/libkshark.c @@ -303,6 +303,12 @@ ssize_t kshark_get_task_pids(struct kshark_context *kshark_ctx, int **pids) } } + if (!pid_count) { + free(*pids); + *pids = NULL; + return pid_count; + } + temp_pids = realloc(*pids, pid_count * sizeof(int)); if (!temp_pids) goto fail; From patchwork Wed Jul 11 13:37:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10758659 Return-Path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:38004 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387878AbeGKNmM (ORCPT ); Wed, 11 Jul 2018 09:42:12 -0400 Received: by mail-wm0-f68.google.com with SMTP id 69-v6so2580728wmf.3 for ; Wed, 11 Jul 2018 06:37:48 -0700 (PDT) From: "Yordan Karadzhov (VMware)" To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, "Yordan Karadzhov (VMware)" Subject: [PATCH 2/2] kernel-shark-qt: Fix the default value of the Event Visible flag Date: Wed, 11 Jul 2018 16:37:09 +0300 Message-Id: <20180711133709.26788-2-y.karadz@gmail.com> In-Reply-To: <20180711133709.26788-1-y.karadz@gmail.com> References: <20180711133709.26788-1-y.karadz@gmail.com> Sender: linux-trace-devel-owner@vger.kernel.org List-ID: This patch fixes a simpel bug in the way the "Event Visible" flag of the kshark_entries is set when the data is loadded. Signed-off-by: Yordan Karadzhov (VMware) --- kernel-shark-qt/src/libkshark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c index 75b88c9..3299752 100644 --- a/kernel-shark-qt/src/libkshark.c +++ b/kernel-shark-qt/src/libkshark.c @@ -600,7 +600,7 @@ static size_t get_records(struct kshark_context *kshark_ctx, kshark_set_entry_values(kshark_ctx, rec, entry); pid = entry->pid; /* Apply event filtering. */ - ret = FILTER_NONE; + ret = FILTER_MATCH; if (adv_filter->filters) ret = pevent_filter_match(adv_filter, rec);