X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng-sessiond%2Fjul.h;fp=src%2Fbin%2Flttng-sessiond%2Fjul.h;h=1f7f6cdcd8e0a176e31095526882c20f51fc528d;hb=0475c50c4d3d2cea973fe4d1f17875d231dea96c;hp=0000000000000000000000000000000000000000;hpb=b9dfb1671626365019a72318fb131eb321244245;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/jul.h b/src/bin/lttng-sessiond/jul.h new file mode 100644 index 000000000..1f7f6cdcd --- /dev/null +++ b/src/bin/lttng-sessiond/jul.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2013 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef _JUL_H +#define _JUL_H + +#include +#include + +/* + * Java Util Logging event representation. + */ +struct jul_event { + /* + * Name of the event which is directly mapped to a Logger object name in + * the JUL API. + */ + char name[LTTNG_SYMBOL_NAME_LEN]; + + /* + * Tells if the event is enabled or not on the JUL Agent. + */ + unsigned int enabled:1; + + /* + * Hash table nodes of the JUL domain. Indexed by name string. + */ + struct lttng_ht_node_str node; +}; + +/* + * Top level data structure in a UST session containing JUL event name created + * for it. + */ +struct jul_domain { + /* + * Contains JUL event indexed by name. + */ + struct lttng_ht *events; +}; + +int jul_init_domain(struct jul_domain *dom); +struct jul_event *jul_create_event(const char *name); +void jul_add_event(struct jul_event *event, struct jul_domain *dom); +struct jul_event *jul_find_by_name(const char *name, struct jul_domain *dom); +void jul_delete_event(struct jul_event *event, struct jul_domain *dom); +void jul_destroy_event(struct jul_event *event); +void jul_destroy_domain(struct jul_domain *dom); + +#endif /* _JUL_H */