Figure out which Library is active?

Hi there,

quick question:
Is there a way to see inside a running darktable instance which [added for clarification: image library/database] library file actual is used in this instance?
Have been looking for that, but did not find …

Thx, Martin

I don’t think this is possible.

If you’re using Linux, you can run a terminal and use ldd to see what dynamic libraries dt is looking for. Here’s what I get for my rather dated instance:

glenn@caliente:~/ImageStuff/darktable-3.0.0/build/src$ ldd darktable (0x00007ffc3c9d7000) => /home/glenn/ImageStuff/darktable-3.0.0/build/src/ (0x00007fa94dafe000) => /lib/x86_64-linux-gnu/ (0x00007fa94d8e4000) => /lib/x86_64-linux-gnu/ (0x00007fa94d8c1000) => /lib/x86_64-linux-gnu/ (0x00007fa94d772000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94d730000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94d607000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ce54000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94cd4f000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94cd3d000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ccee000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94cbcb000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94cba3000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94c9c0000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94c960000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94c7a6000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94c720000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94c712000) => not found => /usr/lib/x86_64-linux-gnu/ (0x00007fa94c70a000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94be1a000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94bcf1000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94bc62000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94bc2a000) => /lib/x86_64-linux-gnu/ (0x00007fa94bc0e000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94bb87000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94bb06000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94baab000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ba80000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b776000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b73b000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b6f9000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b65e000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b47d000) => /lib/x86_64-linux-gnu/ (0x00007fa94b462000)
	/lib64/ (0x00007fa94deaa000) => /lib/x86_64-linux-gnu/ (0x00007fa94b45c000) => /lib/x86_64-linux-gnu/ (0x00007fa94b3e7000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b2aa000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b298000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b290000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b284000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b25a000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b221000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b0ee000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b0d1000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94b0b8000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94afb3000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94af6c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94aeab000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94aea6000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae99000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae8c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae87000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae82000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae3e000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae33000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae2e000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae1d000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ae08000) => /lib/x86_64-linux-gnu/ (0x00007fa94adfd000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94adf0000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ad49000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ad44000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ad1a000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94ad0b000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94aaff000) => /lib/x86_64-linux-gnu/ (0x00007fa94aa9f000) => /lib/x86_64-linux-gnu/ (0x00007fa94aa74000) => /lib/x86_64-linux-gnu/ (0x00007fa94aa58000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94aa4c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a864000) => /lib/x86_64-linux-gnu/ (0x00007fa94a83b000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a830000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a7e8000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a7bf000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a79c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a77c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a70e000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a6fb000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a6c1000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a4eb000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a49c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a446000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a435000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a427000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a1be000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94a113000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949f05000) => /lib/x86_64-linux-gnu/ (0x00007fa949ed7000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949ec9000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949eb6000) => /lib/x86_64-linux-gnu/ (0x00007fa949e63000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949e2c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949dff000) => /lib/x86_64-linux-gnu/ (0x00007fa949df6000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949dec000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949de4000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949ddc000) => /lib/x86_64-linux-gnu/ (0x00007fa949d85000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa949cf5000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa948234000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa9480b0000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa948078000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947ff4000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947d1e000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947be8000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947bd2000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947af3000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947ac2000) => /lib/x86_64-linux-gnu/ (0x00007fa947abb000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947aac000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947a8f000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947a4a000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947a25000) => /lib/x86_64-linux-gnu/ (0x00007fa947976000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94795c000) => /lib/x86_64-linux-gnu/ (0x00007fa947955000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947947000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa9478b4000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94780d000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa9477d5000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa9477bc000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94779b000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94767b000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa947651000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa94763f000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa9475f1000) => /lib/x86_64-linux-gnu/ (0x00007fa9475b6000) => /lib/x86_64-linux-gnu/ (0x00007fa947591000)

hmm. okay.
Perhaps this in addition with some database statistics accessible from inside the app really could be benefitial, wouldn’t it?
E.g. I was experimenting with different libs today (firing up darktable with aliases …). Fiddling around there were occasions when I did not directly recall what actual lib I was loading and had to look that up outside in my calling stacks/aliases. Having such a reference inside the app would have been somewhat more comfortable. But hey… looking at all the brilliant stuff coming with 3.4… there of course needs to be addtl. room for additions in 2021 :crazy_face:

Hi Glenn,
I actually was not referring to sytem libraries used, but to the image library/database loaded for the current instance.

Oops, wrong library… :books:

have you tried lsof or strace ?

I’m sure there is a lua solution to this right now, I just don’t know how to code it.

The Lua API knows what the configuration directory is, so it could tell you which configuration directory you are using. If you override the library with the command line, then the API doesn’t have access to that information.

Can you just specify them implicitly so you know…using a command line parameter…when messing around with more than one install I think this is the best way to keep things clean…tell DT where to go…darktable [-d {all,cache,camctl,camsupport,control,dev,
[–library ]
[–datadir ]
[–moduledir ]
[–tmpdir ]
[–configdir ]
[–cachedir ]
[–localedir ]
[–luacmd ]
[–noiseprofiles ]
[–conf =]

I did use this parameters, invoked via aliases …
It just would have been convenient to get some infos regarding the active database inside dt without need to exit.
As far as I remember other programs (lightroom … :roll_eyes:) there at least has been an option to get some infos inside the program about the currently active database. Therefore I was looking also in darktable to find something …

We could expose more items to the lua configuration API. Unfortunately we are in feature freeze, so this wouldn’t be available until 3.6

If one is already making a startup file that specifies which db, cachedir, etc to use, couldn’t one use the --luacmd to just set a variable that then gets read into a GUI widget? Its a bit manual, but manual work is required anyway to make a startup script that specifies all the things.

You could, but… The luacmd runs after the luarc, so you couldn’t require your GUI widget in the luarc or it would try and read a variable that didn’t exist. So your luacmd would end up looking something like

--luacmd "sysdat = {} ; sysdat['library'] = \"/path/to/librarydb\" ; sysdat['data'] = \"/path/to/datadb\" ; require \"contrib/sysdatgui\""

and for testing contrib/sysdatgui could be as simple as

local dt = require "darktable"
dt.print_log("library db is " .. sysdat.library)
dt.print_log("data db is " ..

and later you could use a text widget and wrap it in a lib

The luacmd above would work on linux and macos. Windows has different quoting rules, so the syntax would change.

1 Like