projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
control flow .c move
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
main.c
diff --git
a/ltt/branches/poly/lttv/main.c
b/ltt/branches/poly/lttv/main.c
index b588e42910e3db6df84f8b2ded10215f11297970..7da2a99d46452f7e614875b51ece887249b166ef 100644
(file)
--- a/
ltt/branches/poly/lttv/main.c
+++ b/
ltt/branches/poly/lttv/main.c
@@
-2,10
+2,13
@@
#include <lttv/hook.h>
#include <lttv/module.h>
#include <lttv/lttv.h>
#include <lttv/hook.h>
#include <lttv/module.h>
#include <lttv/lttv.h>
+#include <lttv/iattribute.h>
#include <lttv/attribute.h>
#include <lttv/option.h>
#include <lttv/traceset.h>
#include <ltt/trace.h>
#include <lttv/attribute.h>
#include <lttv/option.h>
#include <lttv/traceset.h>
#include <ltt/trace.h>
+#include <stdio.h>
+
void lttv_option_init(int argc, char **argv);
void lttv_option_destroy();
void lttv_option_init(int argc, char **argv);
void lttv_option_destroy();
@@
-13,11
+16,14
@@
void lttv_option_destroy();
void lttv_module_init(int argc, char **argv);
void lttv_module_destroy();
void lttv_module_init(int argc, char **argv);
void lttv_module_destroy();
+void lttv_state_init(int argc, char **argv);
+void lttv_state_destroy();
+
/* The main program maintains a few central data structures and relies
on modules for the rest. These data structures may be accessed by modules
through an exported API */
/* The main program maintains a few central data structures and relies
on modules for the rest. These data structures may be accessed by modules
through an exported API */
-static LttvIAttribute
s
*attributes;
+static LttvIAttribute *attributes;
static LttvHooks
*before_options,
static LttvHooks
*before_options,
@@
-37,17
+43,14
@@
static void lttv_module_option(void *hook_data);
static void lttv_module_path_option(void *hook_data);
static void lttv_module_path_option(void *hook_data);
-#ifdef MEMDEBUG
-extern struct GMemVTable *glib_mem_profiler_table;
-#endif
-
+static void lttv_help(void);
/* Since everything is done in modules, the main program only takes care
of the infrastructure. */
int main(int argc, char **argv) {
/* Since everything is done in modules, the main program only takes care
of the infrastructure. */
int main(int argc, char **argv) {
- LttvAttributeValue
*
value;
+ LttvAttributeValue value;
#ifdef MEMDEBUG
g_mem_set_vtable(glib_mem_profiler_table);
#ifdef MEMDEBUG
g_mem_set_vtable(glib_mem_profiler_table);
@@
-55,7
+58,10
@@
int main(int argc, char **argv) {
g_mem_profile();
#endif
g_mem_profile();
#endif
- attributes = LTTV_IATTRIBUTES(g_object_new(LTTV_ATTRIBUTES_TYPE));
+ g_type_init();
+ //g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS | G_TYPE_DEBUG_SIGNALS);
+
+ attributes = LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL));
before_options = lttv_hooks_new();
after_options = lttv_hooks_new();
before_options = lttv_hooks_new();
after_options = lttv_hooks_new();
@@
-64,22
+70,23
@@
int main(int argc, char **argv) {
g_assert(lttv_iattribute_find_by_path(attributes, "hooks/options/before",
LTTV_POINTER, &value));
g_assert(lttv_iattribute_find_by_path(attributes, "hooks/options/before",
LTTV_POINTER, &value));
- *(value
->
v_pointer) = before_options;
+ *(value
.
v_pointer) = before_options;
g_assert(lttv_iattribute_find_by_path(attributes, "hooks/options/after",
LTTV_POINTER, &value));
g_assert(lttv_iattribute_find_by_path(attributes, "hooks/options/after",
LTTV_POINTER, &value));
- *(value
->
v_pointer) = after_options;
+ *(value
.
v_pointer) = after_options;
g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/before",
LTTV_POINTER, &value));
g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/before",
LTTV_POINTER, &value));
- *(value
->
v_pointer) = before_main;
+ *(value
.
v_pointer) = before_main;
g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/after",
LTTV_POINTER, &value));
g_assert(lttv_iattribute_find_by_path(attributes, "hooks/main/after",
LTTV_POINTER, &value));
- *(value
->
v_pointer) = after_main;
+ *(value
.
v_pointer) = after_main;
/* Initialize the command line options processing */
lttv_option_init(argc,argv);
lttv_module_init(argc,argv);
/* Initialize the command line options processing */
lttv_option_init(argc,argv);
lttv_module_init(argc,argv);
+ lttv_state_init(argc,argv);
/* Initialize the module loading */
/* Initialize the module loading */
@@
-88,18
+95,25
@@
int main(int argc, char **argv) {
/* Add some built-in options */
lttv_option_add("module",'m', "load a module", "name of module to load",
/* Add some built-in options */
lttv_option_add("module",'m', "load a module", "name of module to load",
- LTTV_OPT_STRING, &a
M
odule, lttv_module_option, NULL);
+ LTTV_OPT_STRING, &a
_m
odule, lttv_module_option, NULL);
lttv_option_add("modules-path", 'L',
"add a directory to the module search path",
lttv_option_add("modules-path", 'L',
"add a directory to the module search path",
- "directory to add to the path", LTTV_OPT_STRING, &a
ModuleP
ath,
+ "directory to add to the path", LTTV_OPT_STRING, &a
_module_p
ath,
lttv_module_path_option, NULL);
lttv_module_path_option, NULL);
-
+
+ lttv_option_add("help",'h', "basic help", "none",
+ LTTV_OPT_NONE, NULL, lttv_help, NULL);
+
+
lttv_hooks_call(before_options, NULL);
lttv_hooks_call(before_options, NULL);
+ lttv_option_parse(argc, argv);
lttv_hooks_call(after_options, NULL);
lttv_hooks_call(after_options, NULL);
+
lttv_hooks_call(before_main, NULL);
lttv_hooks_call(after_main, NULL);
lttv_hooks_call(before_main, NULL);
lttv_hooks_call(after_main, NULL);
+ lttv_state_destroy();
lttv_module_destroy();
lttv_option_destroy();
lttv_module_destroy();
lttv_option_destroy();
@@
-116,9
+130,9
@@
int main(int argc, char **argv) {
}
}
-
lttv_attributes
*lttv_global_attributes()
+
LttvAttribute
*lttv_global_attributes()
{
{
- return attributes;
+ return
(LttvAttribute*)
attributes;
}
}
@@
-130,5
+144,13
@@
void lttv_module_option(void *hook_data)
void lttv_module_path_option(void *hook_data)
{
void lttv_module_path_option(void *hook_data)
{
- lttv_module_path_add(a_path);
+ lttv_module_path_add(a_module_path);
+}
+
+void lttv_help()
+{
+ printf("Linux Trace Toolkit Visualizer\n");
+ printf("\n");
+ lttv_option_show_help();
+ printf("\n");
}
}
This page took
0.024583 seconds
and
4
git commands to generate.