1ROFI(DEBUGGING) debugging ROFI(DEBUGGING)
2
3
4
6 Debugging rofi.
7
8
9 When reporting an issue with rofi crashing, or misbehaving. It helps to
10 do some small test to help pin-point the problem.
11
12
13 First try disabling your custom configuration: -no-config
14
15
16 This disables the parsing of the configuration files. This runs rofi in
17 stock mode.
18
19
20 If you run custom C plugins, you can disable the plugins using: -no-
21 plugins
22
23
25 Please pastebin the output of the following commands:
26
27
28 rofi -help
29 rofi -dump-config
30 rofi -dump-theme
31
32
33
34 rofi -help provides us with the configuration files parsed, the exact
35 version, monitor layout and more useful information.
36
37
38 The rofi -dump-config and rofi -dump-theme output gives us rofi inter‐
39 pretation of your configuration and theme.
40
41
42 Please check the output for identifiable information and remove this.
43
44
46 To get a timing trace, enable the Timings debug domain.
47
48
49 G_MESSAGES_DEBUG=Timings rofi -show drun
50
51
52
53 It will show a trace with (useful) timing information at relevant
54 points during the execution. This will help debugging when rofi is
55 slow to start.
56
57
58 Example trace:
59
60
61 (process:14942): Timings-DEBUG: 13:47:39.335: 0.000000 (0.000000): Started
62 (process:14942): Timings-DEBUG: 13:47:39.335: 0.000126 (0.000126): ../source/rofi.c:main:786
63 (process:14942): Timings-DEBUG: 13:47:39.335: 0.000163 (0.000037): ../source/rofi.c:main:819
64 (process:14942): Timings-DEBUG: 13:47:39.336: 0.000219 (0.000056): ../source/rofi.c:main:826 Setup Locale
65 (process:14942): Timings-DEBUG: 13:47:39.337: 0.001235 (0.001016): ../source/rofi.c:main:828 Collect MODI
66 (process:14942): Timings-DEBUG: 13:47:39.337: 0.001264 (0.000029): ../source/rofi.c:main:830 Setup MODI
67 (process:14942): Timings-DEBUG: 13:47:39.337: 0.001283 (0.000019): ../source/rofi.c:main:834 Setup mainloop
68 (process:14942): Timings-DEBUG: 13:47:39.337: 0.001369 (0.000086): ../source/rofi.c:main:837 NK Bindings
69 (process:14942): Timings-DEBUG: 13:47:39.337: 0.001512 (0.000143): ../source/xcb.c:display_setup:1177 Open Display
70 (process:14942): Timings-DEBUG: 13:47:39.337: 0.001829 (0.000317): ../source/xcb.c:display_setup:1192 Setup XCB
71 (process:14942): Timings-DEBUG: 13:47:39.346: 0.010650 (0.008821): ../source/rofi.c:main:844 Setup Display
72 (process:14942): Timings-DEBUG: 13:47:39.346: 0.010715 (0.000065): ../source/rofi.c:main:848 Setup abe
73 (process:14942): Timings-DEBUG: 13:47:39.350: 0.015101 (0.004386): ../source/rofi.c:main:883 Load cmd config
74 (process:14942): Timings-DEBUG: 13:47:39.351: 0.015275 (0.000174): ../source/rofi.c:main:907 Setup Modi
75 (process:14942): Timings-DEBUG: 13:47:39.351: 0.015291 (0.000016): ../source/view.c:rofi_view_workers_initialize:1922 Setup Threadpool, start
76 (process:14942): Timings-DEBUG: 13:47:39.351: 0.015349 (0.000058): ../source/view.c:rofi_view_workers_initialize:1945 Setup Threadpool, done
77 (process:14942): Timings-DEBUG: 13:47:39.367: 0.032018 (0.016669): ../source/rofi.c:main:1000 Setup late Display
78 (process:14942): Timings-DEBUG: 13:47:39.367: 0.032080 (0.000062): ../source/rofi.c:main:1003 Theme setup
79 (process:14942): Timings-DEBUG: 13:47:39.367: 0.032109 (0.000029): ../source/rofi.c:startup:668 Startup
80 (process:14942): Timings-DEBUG: 13:47:39.367: 0.032121 (0.000012): ../source/rofi.c:startup:677 Grab keyboard
81 (process:14942): Timings-DEBUG: 13:47:39.368: 0.032214 (0.000093): ../source/view.c:__create_window:701 xcb create window
82 (process:14942): Timings-DEBUG: 13:47:39.368: 0.032235 (0.000021): ../source/view.c:__create_window:705 xcb create gc
83 (process:14942): Timings-DEBUG: 13:47:39.368: 0.033136 (0.000901): ../source/view.c:__create_window:714 create cairo surface
84 (process:14942): Timings-DEBUG: 13:47:39.369: 0.033286 (0.000150): ../source/view.c:__create_window:723 pango cairo font setup
85 (process:14942): Timings-DEBUG: 13:47:39.369: 0.033351 (0.000065): ../source/view.c:__create_window:761 configure font
86 (process:14942): Timings-DEBUG: 13:47:39.381: 0.045896 (0.012545): ../source/view.c:__create_window:769 textbox setup
87 (process:14942): Timings-DEBUG: 13:47:39.381: 0.045944 (0.000048): ../source/view.c:__create_window:781 setup window attributes
88 (process:14942): Timings-DEBUG: 13:47:39.381: 0.045955 (0.000011): ../source/view.c:__create_window:791 setup window fullscreen
89 (process:14942): Timings-DEBUG: 13:47:39.381: 0.045966 (0.000011): ../source/view.c:__create_window:797 setup window name and class
90 (process:14942): Timings-DEBUG: 13:47:39.381: 0.045974 (0.000008): ../source/view.c:__create_window:808 setup startup notification
91 (process:14942): Timings-DEBUG: 13:47:39.381: 0.045981 (0.000007): ../source/view.c:__create_window:810 done
92 (process:14942): Timings-DEBUG: 13:47:39.381: 0.045992 (0.000011): ../source/rofi.c:startup:679 Create Window
93 (process:14942): Timings-DEBUG: 13:47:39.381: 0.045999 (0.000007): ../source/rofi.c:startup:681 Parse ABE
94 (process:14942): Timings-DEBUG: 13:47:39.381: 0.046113 (0.000114): ../source/rofi.c:startup:684 Config sanity check
95 (process:14942): Timings-DEBUG: 13:47:39.384: 0.048229 (0.002116): ../source/dialogs/run.c:get_apps:216 start
96 (process:14942): Timings-DEBUG: 13:47:39.390: 0.054626 (0.006397): ../source/dialogs/run.c:get_apps:336 stop
97 (process:14942): Timings-DEBUG: 13:47:39.390: 0.054781 (0.000155): ../source/dialogs/drun.c:get_apps:634 Get Desktop apps (start)
98 (process:14942): Timings-DEBUG: 13:47:39.391: 0.055264 (0.000483): ../source/dialogs/drun.c:get_apps:641 Get Desktop apps (user dir)
99 (process:14942): Timings-DEBUG: 13:47:39.418: 0.082884 (0.027620): ../source/dialogs/drun.c:get_apps:659 Get Desktop apps (system dirs)
100 (process:14942): Timings-DEBUG: 13:47:39.418: 0.082944 (0.000060): ../source/dialogs/drun.c:get_apps_history:597 Start drun history
101 (process:14942): Timings-DEBUG: 13:47:39.418: 0.082977 (0.000033): ../source/dialogs/drun.c:get_apps_history:617 Stop drun history
102 (process:14942): Timings-DEBUG: 13:47:39.419: 0.083638 (0.000661): ../source/dialogs/drun.c:get_apps:664 Sorting done.
103 (process:14942): Timings-DEBUG: 13:47:39.419: 0.083685 (0.000047): ../source/view.c:rofi_view_create:1759
104 (process:14942): Timings-DEBUG: 13:47:39.419: 0.083700 (0.000015): ../source/view.c:rofi_view_create:1783 Startup notification
105 (process:14942): Timings-DEBUG: 13:47:39.419: 0.083711 (0.000011): ../source/view.c:rofi_view_create:1786 Get active monitor
106 (process:14942): Timings-DEBUG: 13:47:39.420: 0.084693 (0.000982): ../source/view.c:rofi_view_refilter:1028 Filter start
107 (process:14942): Timings-DEBUG: 13:47:39.421: 0.085992 (0.001299): ../source/view.c:rofi_view_refilter:1132 Filter done
108 (process:14942): Timings-DEBUG: 13:47:39.421: 0.086090 (0.000098): ../source/view.c:rofi_view_update:982
109 (process:14942): Timings-DEBUG: 13:47:39.421: 0.086123 (0.000033): ../source/view.c:rofi_view_update:1002 Background
110 (process:14942): Timings-DEBUG: 13:47:39.428: 0.092864 (0.006741): ../source/view.c:rofi_view_update:1008 widgets
111
112
113
115 To further debug the plugin, you can get a trace with (lots of) debug
116 information. This debug output can be enabled for multiple parts in
117 rofi using the glib debug framework. Debug domains can be enabled by
118 setting the G_MESSAGES_DEBUG environment variable. At the time of cre‐
119 ation of this page, the following debug domains exist:
120
121
122 • all: Show debug information from all domains.
123
124 • X11Helper: The X11 Helper functions.
125
126 • View: The main window view functions.
127
128 • Widgets.Box: The Box widget.
129
130 • Modes.DMenu: The dmenu mode.
131
132 • Modes.Run: The run mode.
133
134 • Modes.DRun: The desktop file run mode.
135
136 • Modes.Window: The window mode.
137
138 • Modes.Script: The script mode.
139
140 • Modes.Combi: The script mode.
141
142 • Modes.Ssh: The ssh mode.
143
144 • Rofi: The main application.
145
146 • Timings: Get timing output.
147
148 • Theme: Theme engine debug output. (warning lots of output).
149
150 • Widgets.Icon: The Icon widget.
151
152 • Widgets.Box: The box widget.
153
154 • Widgets.Container: The container widget.
155
156 • Widgets.Window: The window widget.
157
158 • Helpers.IconFetcher: Information about icon lookup.
159
160
161
162 For full list see man rofi.
163
164
165 Example: G_MESSAGES_DEBUG=Dialogs.DRun rofi -show drun To get specific
166 output from the Desktop file run dialog.
167
168
169 To redirect the debug output to a file (~/rofi.log) add:
170
171
172 rofi -show drun -log ~/rofi.log
173
174
175
176 Specifying the logfile automatically enabled all log domains. This can
177 be useful when rofi is launched from a window manager.
178
179
181 First make sure you compile rofi with debug symbols:
182
183
184 make CFLAGS="-O0 -g3" clean rofi
185
186
187
188 Getting a backtrace using GDB is not very handy. Because if rofi get
189 stuck, it grabs keyboard and mouse. So if it crashes in GDB you are
190 stuck. The best way to go is to enable core file. (ulimit -c unlimited
191 in bash) then make rofi crash. You can then load the core in GDB.
192
193
194 gdb rofi core
195
196
197
198 Then type inside gdb:
199
200
201 thread apply all bt
202
203
204
205 The output trace is useful when reporting crashes.
206
207
208 Some distribution have systemd-coredump, this way you can easily get a
209 backtrace via coredumpctl.
210
211
213 rofi-sensible-terminal(1), dmenu(1), rofi-debugging(5), rofi-theme(5),
214 rofi-script(5), rofi-keys(5),rofi-theme-selector(1)
215
216
218 • Qball Cow qball@blame.services ⟨mailto:qball@blame.services⟩
219
220
221
222
223rofi 5 ROFI(DEBUGGING)