I would like to suggest adding to lttng.h an lttng_domain_type enum value of 
LTTNG_DOMAIN_UNSPECIFIED = 0.

enum lttng_domain_type {
+       LTTNG_DOMAIN_UNSPECIFIED              = 0,
        LTTNG_DOMAIN_KERNEL                   = 1,

   This would simplify handling of domain option switches (-k/--kernel, 
-u/--userspace) in the various commands (add_context, calibrate, etc.).  
Instead of a chain of if-else-if checking the command-line options (currently 
opt_kernel, opt_userspace) one at a time, we could have the command-line 
interpreter set an opt_domain variable (initially LTTNG_DOMAIN_UNSPECIFIED) as 
each domain switch is encountered (allowing for easily recognising a 
multiple-context situation as a (opt_domain != LTTNG_DOMAIN_UNSPECIFIED) test), 
and later processing could use a switch instead of the aforementioned 
if-then-else-if chain.  It would make adding the currently planned additional 
domains easier.

Daniel U. Thibault
R & D pour la défense Canada - Valcartier (RDDC Valcartier) / Defence R&D 
Canada - Valcartier (DRDC Valcartier)
Système de systèmes (SdS) / System of Systems (SoS)
Solutions informatiques et expérimentations (SIE) / Computing Solutions and 
Experimentations (CSE)
2459 Boul. Pie XI Nord
Québec, QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC: 918V QSDJ
Gouvernement du Canada / Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to