On 11/19/2009 02:34 PM, Denys Vlasenko wrote:
On Thu, 2009-11-19 at 12:29 +0100, Jiri Moskovcak wrote:
On 11/18/2009 04:03 PM, Denys Vlasenko wrote:
Immediate planned work:
- Discuss auto-dlopening of plugins.
I don't like this, because how would user disable the plugin? If he didn't want to use it? I know it shouldn't be mentioned in config file then, but still, if I don't want to have this enabled, it shouldn't enable it self automatically.
The though occurred to me when I was testing RunApp plugin for inclusion of Xorg.0.log for X crashes.
I modified the abrt.conf by adding ActionsAndReporters = RunApp(...):
# Common abrt settings [ Common ] # With this option set to "yes", # only crashes in signed packages will be analyzed. OpenGPGCheck = no # GPG keys OpenGPGPublicKeys = /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora # Blacklisted packages BlackList = nspluginwrapper # Enabled plugins. There has to be exactly one database plugin EnabledPlugins = SQLite3, CCpp, Logger, Kerneloops, KerneloopsScanner, KerneloopsReporter, Bugzilla, Python # Database Database = SQLite3 # Max size for crash storage [MiB] MaxCrashReportsSize = 1000 # Vector of actions and reporters which are activated immediately after a crash occurs ActionsAndReporters = RunApp("test x`cat component` = xxorg-x11-server-Xorg&& cp /var/log/Xorg.0.log .")
run tested it - BUMMER! "RunApp plugin is not loaded"!
Yep, I need to add it to EnabledPlugins.
I am afraid a lot of users will bitch "wtf, can't this damn program understand that if I said ActionsAndReporters = abc, them obviously abc plugin should be loaded?"
And they are right - abrt can figure it out.
It can be easily done without resorting to scanning every .conf directive for plugin names: instead, we can teach GetAction(pluginName), GetReporter() et al. to try to load the plugin if it is not loaded yet, and complain only when load attempt fails.
Currently, it errors out with "Plugin '%s' is not registered" if plugin is not registered. It may well just register it, and continue.
This way, EnabledPlugins = ... directive will mean "load these plugins right at the start" - because some of them, like ccpp, do important initialization. And pludins which do not have important things to do at initialization won't need to be listed there.
Ok, I agree here, that action plugins (and reporters as they are required by some analyzers??) may be enabled on demand without being listed in config file explicitly, so user doesn't even have to know that the "action" is done by some plugin. But I think it would be great to do some more surgery into abrt.conf e.g. move analyzer - reporter association from abrt.conf to per plugin conf.
Actually, now that I looked at the code, I have a tangential question - why we load *all* plugins, then *register* only some of them? This means unused plugins still take up some memory, right? Why do we need two different concepts of "loaded" and "registered"? One might be enough...
1. load all plugins to determine which plugins do we have (as we can't trust the config file :)) 2. enable (run init() at least I hope it works that way) only those plugins we want (listed in conf file)
So what is the proposal here? To load and enable all installed plugins?
-- vda