kernel-shark: Enforce update of the OpenGL widget when loading new session
PATCH 1/2 kernel-shark: Enforce update of the OpenGL widget when loading new session
This is needed in the case when the session was saved at different screen resolution.
Reported-by Steven Rostedt (VMware) <[email protected]>
Signed-off-by Yordan Karadzhov <[email protected]>
--- kernel-shark/src/KsGLWidget.hpp | 2 ++ kernel-shark/src/KsMainWindow.cpp | 3 +-- kernel-shark/src/KsTraceGraph.cpp | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-)
kernel-shark/src/KsGLWidget.hpp +2 -0
@@ -41,6 +41,8 @@ public: void reset(); + void update() {resizeGL(width(), height());} + void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event);
kernel-shark/src/KsMainWindow.cpp +1 -2
@@ -435,7 +435,6 @@ QString KsMainWindow::lastSessionFile() void KsMainWindow::_restoreSession() { loadSession(lastSessionFile()); - _graph.updateGeom(); } void KsMainWindow::_importSession()
@@ -450,7 +449,6 @@ void KsMainWindow::_importSession() return; loadSession(fileName); - _graph.updateGeom(); } void KsMainWindow::_updateSession()
@@ -1100,6 +1098,7 @@ void KsMainWindow::loadSession(const QString &fileName) _session.loadTable(&_view); _colorPhaseSlider.setValue(_session.getColorScheme() * 100); + _graph.updateGeom(); } void KsMainWindow::_initCapture()
kernel-shark/src/KsTraceGraph.cpp +2 -0
@@ -538,6 +538,8 @@ void KsTraceGraph::updateGeom() * allow the scroll bar to disappear when the * widget is extended to maximum. */ + + _glWindow.update(); } void KsTraceGraph::_updateGraphLegends()
Signature · 1 line
2.20.1
PATCH 2/2 kernel-shark: Add "Report bug" button to "Help"
When clicked, the Bugzilla will be opened in the appropriate Web browser for the user's desktop environment.
Suggested-by Steven Rostedt (VMware) <[email protected]>
Signed-off-by Yordan Karadzhov <[email protected]>
--- kernel-shark/src/KsMainWindow.cpp | 13 +++++++++++++ kernel-shark/src/KsMainWindow.hpp | 4 ++++ 2 files changed, 17 insertions(+)
kernel-shark/src/KsMainWindow.cpp +13 -0
@@ -67,6 +67,7 @@ KsMainWindow::KsMainWindow(QWidget *parent) _fullScreenModeAction("Full Screen Mode", this), _aboutAction("About", this), _contentsAction("Contents", this), + _bugReportAction("Report a bug", this), _deselectShortcut(this), _settings("kernelshark.org", "Kernel Shark") // organization , application {
@@ -288,6 +289,9 @@ void KsMainWindow::_createActions() _contentsAction.setIcon(QIcon::fromTheme("help-contents")); connect(&_contentsAction, &QAction::triggered, this, &KsMainWindow::_contents); + + connect(&_bugReportAction, &QAction::triggered, + this, &KsMainWindow::_bugReport); } void KsMainWindow::_createMenus()
@@ -365,6 +369,7 @@ void KsMainWindow::_createMenus() help = menuBar()->addMenu("Help"); help->addAction(&_aboutAction); help->addAction(&_contentsAction); + help->addAction(&_bugReportAction); } void KsMainWindow::_open()
@@ -925,6 +930,14 @@ void KsMainWindow::_contents() QUrl::TolerantMode)); } +void KsMainWindow::_bugReport() +{ + QUrl bugs("https://bugzilla.kernel.org/buglist.cgi?component=Trace-cmd%2FKernelshark&product=Tools&resolution=---", + QUrl::TolerantMode); + + QDesktopServices::openUrl(bugs); +} + /** Load trace data for file. */ void KsMainWindow::loadDataFile(const QString& fileName) {
kernel-shark/src/KsMainWindow.hpp +4 -0
@@ -151,6 +151,8 @@ private: QAction _contentsAction; + QAction _bugReportAction; + QShortcut _deselectShortcut; QString _lastDataFilePath, _lastConfFilePath, _lastPluginFilePath;
@@ -205,6 +207,8 @@ private: void _contents(); + void _bugReport(); + void _captureStarted(); void _captureError(QProcess::ProcessError error);
Signature · 1 line
2.20.1
Quoted 11 lines · Yordan Karadzhov
This is needed in the case when the session was saved at different screen resolution.
Reported-by Steven Rostedt (VMware) <[email protected]>Signed-off-by Yordan Karadzhov <[email protected]>--- kernel-shark/src/KsGLWidget.hpp | 2 ++ kernel-shark/src/KsMainWindow.cpp | 3 +-- kernel-shark/src/KsTraceGraph.cpp | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-)
Both patches look good to me
Reviewed-by Slavomir Kaslev <[email protected]>
Cheers,
-- Slavi