diff mbox series

kernel-shark: Show multi-line events in quick view

Message ID 20221214154643.43a4e137@gandalf.local.home (mailing list archive)
State New
Headers show
Series kernel-shark: Show multi-line events in quick view | expand

Commit Message

Steven Rostedt Dec. 14, 2022, 8:46 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

Some events (stack traces) have multiple lines, but the list view of each
event is just a single line. To get the content of the full event, if the
user selects the right mouse button over the event to trigger the quick
view, display the entire content of the event.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 src/KsQuickContextMenu.cpp | 9 +++++++++
 src/KsQuickContextMenu.hpp | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

Comments

Yordan Karadzhov Dec. 20, 2022, 4:51 p.m. UTC | #1
On 12/14/22 22:46, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> 
> Some events (stack traces) have multiple lines, but the list view of each
> event is just a single line. To get the content of the full event, if the
> user selects the right mouse button over the event to trigger the quick
> view, display the entire content of the event.
> 
Hi Steven

I wonder if the context menu is the best place to display those 
multi-line events. This menu is quite busy already and if you want to 
check a number of events, each time you have to open it then close it 
and reopen it again in order to see the next event. I think this can be 
a bit annoying.

An alternative can be to use the dual marker. For example we can make it 
to work such that all lines of the event selected with the markers are 
shown directly into the table.

I am attaching a RFC patch that that implements this. Note that I didn't 
time to fully test and debug this for all corner cases, but it should 
work at leas for the most straight-forward  use case. Please try it and 
tell me what you think.

Thanks!
Y.

> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>   src/KsQuickContextMenu.cpp | 9 +++++++++
>   src/KsQuickContextMenu.hpp | 2 +-
>   2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/src/KsQuickContextMenu.cpp b/src/KsQuickContextMenu.cpp
> index 6fa242de348d..cc714bfb1aae 100644
> --- a/src/KsQuickContextMenu.cpp
> +++ b/src/KsQuickContextMenu.cpp
> @@ -52,6 +52,7 @@ KsQuickContextMenu::KsQuickContextMenu(KsDualMarkerSM *dm,
>     _row(row),
>     _rawTime(this),
>     _rawEvent(this),
> +  _eventInfo(this),
>     _graphSyncCBox(nullptr),
>     _listSyncCBox(nullptr),
>     _hideTaskAction(this),
> @@ -104,6 +105,14 @@ KsQuickContextMenu::KsQuickContextMenu(KsDualMarkerSM *dm,
>   		evtData += field + ":  " + val.setNum(fieldVal) + "\n\t";
>   	}
>   
> +	QString evtInfo("\t");
> +	evtInfo += kshark_get_info(entry);
> +	evtInfo += "\n";
> +
> +	addSection("Event info");
> +	_eventInfo.setDefaultWidget(new QLabel(evtInfo));
> +	addAction(&_eventInfo);
> +
>   	addSection("Raw event");
>   	time = QString("\ttime:  %1 [ns]").arg(entry->ts);
>   
> diff --git a/src/KsQuickContextMenu.hpp b/src/KsQuickContextMenu.hpp
> index ca0b341dd363..c07c1a534d3a 100644
> --- a/src/KsQuickContextMenu.hpp
> +++ b/src/KsQuickContextMenu.hpp
> @@ -91,7 +91,7 @@ private:
>   
>   	size_t		_row;
>   
> -	QWidgetAction	_rawTime, _rawEvent;
> +	QWidgetAction	_rawTime, _rawEvent, _eventInfo;
>   
>   	QCheckBox	*_graphSyncCBox, *_listSyncCBox;
>
Steven Rostedt Dec. 21, 2022, 4:35 p.m. UTC | #2
On Tue, 20 Dec 2022 18:51:03 +0200
Yordan Karadzhov <y.karadz@gmail.com> wrote:
> 
> I wonder if the context menu is the best place to display those 
> multi-line events. This menu is quite busy already and if you want to 
> check a number of events, each time you have to open it then close it 
> and reopen it again in order to see the next event. I think this can be 
> a bit annoying.

It doesn't annoy me ;-)

> 
> An alternative can be to use the dual marker. For example we can make it 
> to work such that all lines of the event selected with the markers are 
> shown directly into the table.
> 
> I am attaching a RFC patch that that implements this. Note that I didn't 
> time to fully test and debug this for all corner cases, but it should 
> work at leas for the most straight-forward  use case. Please try it and 
> tell me what you think.
> 

This works too. Either way, as long as I can get to the data.

Also, for another feature request. Is it possible to implement a copy of
the text in the list view? I would like to select text and copy it so that
I can paste it into other windows.

Thanks!

-- Steve
Yordan Karadzhov Dec. 21, 2022, 7:27 p.m. UTC | #3
On 12/21/22 18:35, Steven Rostedt wrote:
> Also, for another feature request. Is it possible to implement a copy of
> the text in the list view? I would like to select text and copy it so that
> I can paste it into other windows.

Should be possible. I will have a look.
Cheers,
Y.
diff mbox series

Patch

diff --git a/src/KsQuickContextMenu.cpp b/src/KsQuickContextMenu.cpp
index 6fa242de348d..cc714bfb1aae 100644
--- a/src/KsQuickContextMenu.cpp
+++ b/src/KsQuickContextMenu.cpp
@@ -52,6 +52,7 @@  KsQuickContextMenu::KsQuickContextMenu(KsDualMarkerSM *dm,
   _row(row),
   _rawTime(this),
   _rawEvent(this),
+  _eventInfo(this),
   _graphSyncCBox(nullptr),
   _listSyncCBox(nullptr),
   _hideTaskAction(this),
@@ -104,6 +105,14 @@  KsQuickContextMenu::KsQuickContextMenu(KsDualMarkerSM *dm,
 		evtData += field + ":  " + val.setNum(fieldVal) + "\n\t";
 	}
 
+	QString evtInfo("\t");
+	evtInfo += kshark_get_info(entry);
+	evtInfo += "\n";
+
+	addSection("Event info");
+	_eventInfo.setDefaultWidget(new QLabel(evtInfo));
+	addAction(&_eventInfo);
+
 	addSection("Raw event");
 	time = QString("\ttime:  %1 [ns]").arg(entry->ts);
 
diff --git a/src/KsQuickContextMenu.hpp b/src/KsQuickContextMenu.hpp
index ca0b341dd363..c07c1a534d3a 100644
--- a/src/KsQuickContextMenu.hpp
+++ b/src/KsQuickContextMenu.hpp
@@ -91,7 +91,7 @@  private:
 
 	size_t		_row;
 
-	QWidgetAction	_rawTime, _rawEvent;
+	QWidgetAction	_rawTime, _rawEvent, _eventInfo;
 
 	QCheckBox	*_graphSyncCBox, *_listSyncCBox;