From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 2/3] kernel-shark-qt: Change the input argument of kshark_dump_entry() to const.
Date: Fri, 3 Aug 2018 16:07:58 +0300 [thread overview]
Message-ID: <20180803130759.31858-2-y.karadz@gmail.com> (raw)
In-Reply-To: <20180803130759.31858-1-y.karadz@gmail.com>
kshark_dump_entry() should not be able to modify the content of its input
argument (kshark_entry) which is being dumped to a string. The type of the
argument is changed from "struct kshark_entry*" to "const struct kshark_entry*"
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
kernel-shark-qt/src/libkshark.c | 2 +-
kernel-shark-qt/src/libkshark.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel-shark-qt/src/libkshark.c b/kernel-shark-qt/src/libkshark.c
index 3299752..847c10f 100644
--- a/kernel-shark-qt/src/libkshark.c
+++ b/kernel-shark-qt/src/libkshark.c
@@ -861,7 +861,7 @@ static const char *kshark_get_info(struct pevent *pe,
* @returns The returned string contains a semicolon-separated list of data
* fields.
*/
-char* kshark_dump_entry(struct kshark_entry *entry)
+char* kshark_dump_entry(const struct kshark_entry *entry)
{
const char *event_name, *task, *lat, *info;
struct kshark_context *kshark_ctx;
diff --git a/kernel-shark-qt/src/libkshark.h b/kernel-shark-qt/src/libkshark.h
index 0ad31c0..eda0a83 100644
--- a/kernel-shark-qt/src/libkshark.h
+++ b/kernel-shark-qt/src/libkshark.h
@@ -133,7 +133,7 @@ void kshark_close(struct kshark_context *kshark_ctx);
void kshark_free(struct kshark_context *kshark_ctx);
-char* kshark_dump_entry(struct kshark_entry *entry);
+char* kshark_dump_entry(const struct kshark_entry *entry);
/** Bit masks used to control the visibility of the entry after filtering. */
enum kshark_filter_masks {
--
2.17.1
next prev parent reply other threads:[~2018-08-03 15:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-03 13:07 [PATCH 1/3] kernel-shark-qt: Change the type of the fields in struct kshark_entry Yordan Karadzhov (VMware)
2018-08-03 13:07 ` Yordan Karadzhov (VMware) [this message]
2018-08-03 13:07 ` [PATCH 3/3] kernel-shark-qt: In the Doxygen doc. add spacing after @brief and @param Yordan Karadzhov (VMware)
2018-08-03 18:33 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180803130759.31858-2-y.karadz@gmail.com \
--to=y.karadz@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).