Bug 216404 - kernelshark: function_graph indent broken in list area
Summary: kernelshark: function_graph indent broken in list area
Status: NEW
Alias: None
Product: Tools
Classification: Unclassified
Component: Trace-cmd/Kernelshark (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Default virtual assignee for Trace-cmd and kernelshark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-23 20:40 UTC by Andrej Stender
Modified: 2022-08-25 08:53 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.18.16
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Screenshot of List Area (60.02 KB, image/png)
2022-08-23 20:40 UTC, Andrej Stender
Details

Description Andrej Stender 2022-08-23 20:40:42 UTC
Created attachment 301638 [details]
Screenshot of List Area

When loading a trace.dat in kernelshark which has been created by using the
function_graph tracer, then the C-style indentation is shown in a broken way in
the List Area 'Info' column, because kernelshark does not use a fixed width
font (see screenshot). As a workaround, I used a config file of my KDE to force
a fixed width font for the application kernelshark. Then all looked fine. 

kernelshark: v2.1.1

Wouldn't it make sense to use a fixed width font by default in the 'Info'
column of the List Area (at least when function_tracer is used, if that
distinction can easily be made)? 

Anyway, kernelshark is a great tool which helps me a lot. Thanks for creating it!
Comment 1 Yordan Karadzhov 2022-08-24 11:41:41 UTC
Hi Andrej,

Thanks a lot for reporting this problem!

I agree with you that it will be better if we use a fixed width font. However, using different fonts in the different columns of the table will most likely look ugly. Also there are cases when the number of columns displayed by the table changes, so you will need extra logic to find which column to change. So let's change the font in all columns.

All properties of the table widget are set here:
https://git.kernel.org/pub/scm/utils/trace-cmd/kernel-shark.git/tree/src/KsTraceViewer.cpp#n125

You can add couple of lines, setting a font that has the fixed width.
https://doc.qt.io/qt-6/qwidget.html#font-prop

Perhaps, one from the 'monospace' family will do the job. I know very little about fonts, so I am leaving to you to find solution that displays the function graph data correctly. Send me a patch and I will be happy to take it.

cheers,
Yordan
Comment 2 Andrej Stender 2022-08-25 08:53:56 UTC
Hi Yordan,

thanks for the quick reply. Ok, I'll take a look at the code and see what I can do. 

Best regards,
Andrej

Note You need to log in before you can comment on or make changes to this bug.