Power Outage Corrupted XFS Filesystem | How I Fixed It
Spring cleanup
What you can probably spot from past posts on my blog, my open source contributions are heavily focused on Weblate and I've phased out many other activities. The main reason being reduced amount of free time with growing family, what leads to focusing on project which I like most. It's fun to develop it and it seems like it will work business wise as well, but that's still something to be shown in the future.
Anyway it's time to admit that I will not spend much time on other things in near future.
Earlier this year, I've resigned from being phpMyAdmin project admin. I was in this role for three years and I've been contributing to the project for 18 years. It has been time, but I haven't contributed significantly in last few months. I will stay with the project for few more months to handle smooth transition, but it's time to say good bye there.
On the Debian project I want to stay active, but I've reduced my involvement and I'm looking for maintainers for some of my packages (mostly RPM related). The special case is the phpMyAdmin package where I was looking for help since 2017, but it still didn't help from the package becoming heavily outdated with security issues what lead to it's removal from Buster. It seems that this has triggered enough attention to resurrect work on the updated packages.
Today I've gone through my personal repos on GitHub and I've archived bunch of them. These have not received any attention for years (many of them were dead by the time I've imported them to GitHub) and it's good to clearly show that to random visitors.
I'm still main developer behind Gammu, but I'm not really doing there more than occasional review of pull requests and merging them. I don't want to abandon the project without handing it out to somebody else, but the problem is that there is nobody else right now.
Why precompiled headers do (not) improve C++ compile times
Yeah, so would I. Who wouldn't. C++ is notorious for taking its sweet time to get compiled. I never really cared about PCHs when I worked on KDE, I think I might have tried them once for something and it didn't seem to do a thing. In 2012, while working on LibreOffice, I noticed its build system used to have PCH support, but it had been nuked, with the usual poor OOo/LO style of a commit message stating the obvious (what) without bothering to state the useful (why). For whatever reason, that caught my attention, reportedly PCHs saved a lot of build time with MSVC, so I tried it and it did. And me having brought the PCH support back from the graveyard means that e.g. the Calc module does not take 5:30m to build on a (very) powerful machine, but only 1:45m. That's only one third of the time.
In line with my previous experience, on Linux that did nothing. I made the build system support also PCH with GCC and Clang, because it was there and it was simple to support it too, but there was no point. I don't think anybody has ever used that for real.
Then, about a year ago, I happened to be working on a relatively small C++ project that used some kind of an obscure build system called Premake I had never heard of before. While fixing something in it I noticed it also had PCH support, so guess what, I of course enabled it for the project. It again made the project build faster on Windows. And, on Linux, it did too. Color me surprised.
The idea must have stuck with me, because a couple weeks back I got the idea to look at LO's PCH support again and see if it can be made to improve things. See, the point is, PCHs for that small project were rather small, it just included all the std stuff like <vector> and <string>, which seemed like it shouldn't make much of a difference, but it did. Those standard C++ headers aren't exactly small or simple. So I thought that maybe if LO on Linux used PCHs just for those, it would also make a difference. And it does. It's not breath-taking, but passing --enable-pch=system to configure reduces Calc module build time from 17:15m to 15:15m (that's a less powerful machine than the Windows one). Adding LO base headers containing stuff like OUString makes it go down to 13:44m and adding more LO headers except for Calc's own leads to 12:50m. And, adding even Calc's headers, results in 15:15m again. WTH?
It turns out, there's some limit when PCHs stop making things faster and either don't change anything, or even make things worse. Trying with the Math module, --enable-pch=system and then --enable-pch=base again improve things in a similar fashion, and then --enable-pch=normal or --enable-pch=full just doesn't do a thing. Where it that 2/3 time reduction --enable-pch=full does with MSVC?
Clang has recently received a new option, -ftime-trace, which shows in a really nice and simple way where the compiler spends the time (take that, -ftime-report). And since things related to performance simply do catch my attention, I ended up building the latest unstable Clang just to see what it does. And it does:
So, this is bcaslots.cxx, a smaller .cxx file in Calc. The first graph is without PCH, the second one is with --enable-pch=base, the third one is --enable-pch=full. This exactly confirms what I can see. Making the PCH bigger should result in something like the 4th graph, as it does with MSVC, but it results in things actually taking longer. And it can be seen why. The compiler does spend less and less time parsing the code, so the PCH works, but it spends more time in this 'PerformPendingInstantiations', which is handling templates. So, yeah, in case you've been living under a rock, templates make compiling C++ slow. Every C++ developer feeling really proud about themselves after having written a complicated template, raise your hand (... that includes me too, so let's put them back down, typing with one hand is not much fun). The bigger the PCH the more headers each C++ file ends up including, so it ends up having to cope with more templates. With the largest PCH, the compiler needs to spend only one second parsing code, but then it spends 3 seconds sorting out all kinds of templates, most of which the small source file does not need.
This one is column2.cxx, a larger .cxx file in Calc. Here, the biggest PCH mode leads to some improvement, because this file includes pretty much everything under the sun and then some more, so less parsing makes some savings, while the compiler has to deal with a load of templates again, PCH or not. And again, one second for parsing code, 4 seconds for templates. And, if you look carefully, 4 seconds more to generate code, most of it for those templates. And after the compiler spends all this time on templates in all the source files, it gets all passed to the linker, which will shrug and then throw most of it away (and that will too take a load of time, if you still happen to use the BFD linker instead of gold/lld with -gsplit-dwarf -Wl,--gdb-index). What a marvel.
Now, in case there seems to be something fishy about the graphs, the last graph indeed isn't from MSVC (after all, its reporting options are as "useful" as -ftime-report). It is from Clang. I still know how to do performance magic ...
Coding is a Craft
I remember the exact room I was in the first time I realised that, for me, programming was about more than just solving problems. It was shortly before graduating from University, and I was sat in a meeting room in the Imagination Technologies office in Leeds. My soon-to-be-boss asked me:
“If you weren’t a programmer, what other job would you do?”
No one had ever asked me that before. And I don’t think I’ve ever been asked since. But thinking about it for all of 10 seconds, I realised that I wanted to create things, no matter what job I had.
It’s taken me a long time to accept that it’s OK to want to build things with software that doesn’t simultaneously solve a problem. It’s OK to write code for the sake of it.
Because, personally, writing code feels a lot like practicing a craft. Yes, you get better the more you do it. But it also fulfills a deep-seated desire to bring something into the world that didn’t exist before. Not that I’m saying no one’s ever written a boot loader before, but no one’s ever written a boot loader that way I wrote mine.
Viewed this way, side projects take on a whole new purpose. They’re a great way to exercise your creativity. You need side projects, not necessarily to learn new skills, but to use the ones you already have.
Writing code isn’t just about solving problems. It’s also good for the soul.
Linux perf and KCachegrind
Recently I finally gave Linux perf a try. Not quite sure why I didn't use it before, IIRC when I tried it somewhen long ago, it was probably difficult to set up or something. Using perf record has very little overhead, but I wasn't exactly thrilled by perf report. I mean, it's text UI, and it just gives a list of functions, so if I want to see anything close to a call graph, I have to manually expand one function, expand another function inside it, expand yet another function inside that, and so on. Not that it wouldn't work, but compared to just looking at what KCachegrind shows and seeing ...
When figuring out how to use perf, while watching a talk from Milian Wolff, on one slide I noticed a mention of a Callgrind script. Of course I had to try it. It was a bit slow, but hey, I could finally look at perf results without feeling like that's an effort. Well, and then I improved the part of the script that was slow, so I guess I've just put the effort elsewhere :).
And I thought this little script might be useful for others. After mailing Milian, it turns out he just created the script as a proof of concept and wasn't interested in it anymore, instead developing Hotspot as UI for perf. Fair enough, but I think I still prefer KCachegrind, I'm used to this, and I don't have to switch the UI when switching between perf and callgrind. So, with his agreement, I've submitted the script to KCachegrind. If you would find it useful, just download this do something like:
$ perf record -g ...$ perf script -s perf2calltree.py > perf.out$ kcachegrind perf.out
Weblate blog moved
I've been publishing updates about Weblate on my blog for past seven years. Now the project has grown up enough to deserve own space to publish posts. Please update your bookmarks and RSS readers to new location directly on Weblate website.
The Weblate website will receive another updates in upcoming weeks, I'm really looking forward to these.
New address for Weblate blog is https://weblate.org/news/.
New address for the RSS feed is https://weblate.org/feed/.
openSUSE 42.3 to 15.0 Upgrade notes
Table to json with jq and awk
The problem
Say you have a table that looks like this:
AGGREGATE_NEEDED 1
ARCH x86_64
BASE_TEST_ISSUES NUMBER
BUILD :NUMBER:PACKAGE
DISTRI DISTRIBUTION
FLAVOR Server-DVD-Incidents-Install
INCIDENT_ID 99999
It’s just that it contains about 78 or more entries. Of course for a very skilled engineer or a person with a lot of tricks under the hood, this might be a very trivial task in vim or something like this, I guess that with a couple of replaces here and there, you’d get somewhere; but I’m not skilled, other than at eating.
The Solution
So I took my Key Value table saved it to a file and after googling a bit, now I’m more versed into awk :D:
cat FILE.txt | \
awk 'BEGIN { print "{" } \
{ printf "\"%s\":\"%s\",", $1,$2} \
END { print "\"MANUALLY_GENERATED_ISO_POST\":1 }" }'
| jq > x86_64-ready.json'"}'
I guess this could have been done easier and prettier, but fits my need and might save you too at some point.
Just make sure you have jq installed ok?
EasyTAG: Organize your music with openSUSE
Audio files in formats such as MP3, AAC, and Ogg Vorbis have made music ubiquitous and portable. With the explosive growth of storage capacity, you can store huge libraries of music. But how do you keep all that music organized? Just tag your music. Then you can access it easily locally and in the cloud. EasyTAG is a great choice for tagging music and is available in openSUSE.
Many audio file types support tagging, including:
- MP4, MP3, MP3, MP2
- Ogg Speex, Ogg Vorbis, Ogg Opus
- FLAC
- MusePack
- Monkey Audio
Installing EasyTAG
EasyTAG is easy to install from openSUSE repositories:
Or use Zypper in a terminal as Root:
# zypper install easytag
Then launch the program from the Software tool or the application menu for your desktop. EasyTAG’s straightforward interface works well in most desktop environments.
Tagging music
Select a folder where you have music you want to tag. By default, EasyTAG will also load subfolders. You can select each file and add tag information such as the artist, title, year, and so on. You can also add images to a file in JPG or PNG format, which most players understand.
Files you have altered appear in bold in the file listing. To save each, press Ctrl+S. You can also select the entire list and use Ctrl+Shift+S to save all the files at once.
One of the most powerful features of EasyTAG is the file scanner. The scanner recognizes patterns based on a template you provide. Once you provide the right template and scan files, EasyTAG automatically tags all of them for you. Then you can save them in bulk. This saves a lot of time and frustration when dealing with large libraries.
When you upload your tagged files to a cloud service, your tags allow you to quickly find and play the music you want anytime.
This article is an adaption of EasyTAG: Organize your music on Fedora under Creative Commons License.
Leap 15.1, the release that nobody talks about
openSUSE Leap 15.1 is almost ready for release! (1) This is always a high point of the year for me. I started researching what was new in this release. However, there is not much buzz around this release. I found only a few articles on Softpedia (2), Phoronix (3) and the announcement by Ludwig Nussel (4).
When I tried to establish what was new (5) in Leap 15.1, I started to understand why. Leap 15.1 mostly features minor updates. Still there are updates that are noteworthy. In the table below I highlighted in green the updated packages that are really new. In blue, I highlighted new packages that are also present in updated Leap 15 installations.
| Package name | Leap 15 | Leap 15 | Leap 15.1 | Tumbleweed |
| with updates | ||||
| Amarok | 2.9.0 | 2.9.0 | 2.9.0 | 2.9.0 |
| Audacity | 2.2.2 | 2.2.2 | 2.2.2 | 2.3.1 |
| Calibre | 3.23.0 | 3.27.1 | 3.40.1 | 3.40.1 |
| Calligra suite | 3.1.0 | 3.1.0 | 3.1.0 | 3.1.0 |
| Chromium browser | 66 | 73 | 73 | 73 |
| Darktable | 2.4.3 | 2.4.3 | 2.6.2 | 2.6.2 |
| Digikam | 5.9.0 | 5.9.0 | 6.0.0 | 6.1.0 |
| Flatpack | 0.10.4 | 0.10.4 | 1.2.3 | 1.2.4 |
| GIMP | 2.8.22 | 2.8.22 | 2.8.22 | 2.6.12 |
| Gnome Applications | 3.26 | 3.26 | 3.26 | 3.30 |
| GNU Cash | 3.0 | 3.0 | 3.0 | 3.4 |
| Hugin | 2018.0.0 | 2018.0.0 | 2018.0.0 | 2018.0.0 |
| Inkscape | 0.92.2 | 0.92.2 | 0.92.2 | 0.92.4 |
| KDE Applications | 17.12 | 17.12.3 | 18.12.3 | 19.04.0 |
| KDE Plasma 5 desktop | 5.12.5 | 5.12.8 | 5.12.8 | 5.15.4 |
| Krita | 4.0.3 | 4.0.3 | 4.1.8 | 4.1.8 |
| LibreOffice | 6.0.4 | 6.1.3 | 6.1.3 | 6.2.3 |
| Linux kernel | 4.12.14 | 4.12.14 | 4.12.14* | 5.0.9 |
| Mozilla Firefox | 60.0 | 60.6.1 | 60.6.1 | 66.0.3 |
| Mozilla Thunderbird | 52.7 | 60.6.1 | 60.6.1 | 60.6.1 |
| Pidgin | 2.13 | 2.13 | 2.13 | 2.13 |
| Rapid Photo Downloader | 0.9.9 | 0.9.9 | 0.9.14 | 0.9.14 |
| Scribus | 1.4.7 | 1.4.7 | 1.4.7 | 1.4.7 |
| Shotwell | 0.28.3 | 0.28.3 | 0.28.3 | 0.30.2 |
| VLC | 3.0.2 | 3.0.2 | 3.0.6 | 3.0.6 |
| YaST | 4.0.74 | 4.0.87 | 4.1.68 | 4.2.0 |
Software package updates
Calibre is updated to 3.40 and includes some improvements to Kobo drivers, support for the Kindle Whitepaper 2018, a bunch of improvement for the Edit book functionality, the Content station has a new “Copy to library” function and some usability improvements of the Tag browser.
Darktable is updated to 2.6, including a new retouch module, a new filmic module, a new module to handle duplicates in the darkroom, you can now change the cropped area in the perspective correction module, the mask blur feature has been extended with a guided-filter to fine tune it and the color balance module has two new modes based on ProPhotoRGB and HSL.
Digikam is updated to 6.0. This means that you can now manage video files in the same way as you would manage photos. In the album management, you can now use virtual folders (RAW/JPG/PNG) to sort items in a list. Digikam 6.0 uses libraw 0.19, which enables support for over 200 new RAW files. This includes support for iPhone 8, 8+ and X and support for Samsung S7, S7 Edge and S8. There are also many improvements for connecting with external web services. Finally, Digikam now uses a separate database for fussy and duplicate search, improving performance and reliability.
Flatpack is updated to 1.2.3, which includes many security improvements.
KDE applications got a big update to 18.12. Dolphin (file manager) received many improvements, including the ability to hide the Places panel and dock the Terminal panel. The folder view and settings dialog have been updated. Ocular (PDF and document viewer) has a new typewriter annotation feature that enables you to type everywhere on a page. Konsole (terminal application) now has full support for emoji. The Gwenview (image viewer) has seen many improvements, including the crop tool, the reduce red eye tool, improved zooming and better drag and drop functionality. Spectacle (screenshot tool) gained the ability to sequentially number screenshot files and now remembers the lastest save settings. With the rectangular region selection mode, you can select a part of the screen . Ark (unzip tool) now supports the tar.zst archive file standard.
Krita is updated to 4.1.8 and introduces the new reference images tool that lets you place and edit a reference image to help you with drawing. Another help with drawing is provided by the improved vanishing point assistant. Krita 4.1 features many animation improvements and a better color picker tool.
LibreOffice 6.1 offers 2 new icon themes ‘Colibre’ and ‘Karasa Jaga’, it loads documents with many images faster, the gradient tool has been improved and new fill gradients are available, you can now add page numbers and page counts in the header and footer sections of Writer, you can insert a Signature line in Writer, you can now sort images anchored to cells in Calc, the merge cells dialog box has become much clearer in Calc, you can now use CSVs as data sources in Calc and a new page menu has been added in Impress.
Linux kernel has received some back-ports of Graphics hardware from the Linux kernel 4.19, including better support for AMD Vega cards.
Rapid Photo Downloader (from the Graphics repository) is updated to 0.9.14. Canon’s latest RAW file format CR3 is supported on systems that have ExifTool 10.87 or newer.
YaST has received several improvements and is updated to 4.1.68. YaST has improved the default partitioning proposal for systems with less than 12 GB, YaST received some UI improvements including better support for 4K monitors, the YaST Firewall module has been adapted to work with Firewalld, the Partitioner can now directly format full disks and create MD RAIDs on top of disks without partitions.
Installation options
Besides the standard installation options (full ISO, KDE live ISO, Gnome live ISO, network installer) there is now full support for Raspberry Pi installations. The server installation now features an option for a transactionally updated system. Furthermore there are the more traditional server installations for X86_64 and JeOS (the minimal server installation for the Cloud). You can find the Beta versions of Leap 15.1 here.
Published on: 4 May 2019



