#include <wrapper/poll.h>
#include <wrapper/file.h>
#include <wrapper/kref.h>
+#include <lttng-string-utils.h>
#include <lttng-abi.h>
#include <lttng-abi-old.h>
#include <lttng-events.h>
|| event_param->instrumentation == LTTNG_KERNEL_SYSCALL) {
struct lttng_enabler *enabler;
- if (event_param->name[strlen(event_param->name) - 1] == '*') {
- enabler = lttng_enabler_create(LTTNG_ENABLER_WILDCARD,
+ if (strutils_is_star_glob_pattern(event_param->name)) {
+ /*
+ * If the event name is a star globbing pattern,
+ * we create the special star globbing enabler.
+ */
+ enabler = lttng_enabler_create(LTTNG_ENABLER_STAR_GLOB,
event_param, channel);
} else {
enabler = lttng_enabler_create(LTTNG_ENABLER_NAME,
* should be increased when an incompatible ABI change is done.
*/
#define LTTNG_MODULES_ABI_MAJOR_VERSION 2
-#define LTTNG_MODULES_ABI_MINOR_VERSION 2
+#define LTTNG_MODULES_ABI_MINOR_VERSION 3
#define LTTNG_KERNEL_SYM_NAME_LEN 256
#include <lttng-tracer.h>
#include <lttng-abi-old.h>
#include <lttng-endian.h>
+#include <lttng-string-utils.h>
#include <wrapper/vzalloc.h>
#include <wrapper/ringbuffer/backend.h>
#include <wrapper/ringbuffer/frontend.h>
* Enabler management.
*/
static
-int lttng_match_enabler_wildcard(const char *desc_name,
- const char *name)
+int lttng_match_enabler_star_glob(const char *desc_name,
+ const char *pattern)
{
- /* Compare excluding final '*' */
- if (strncmp(desc_name, name, strlen(name) - 1))
+ if (!strutils_star_glob_match(pattern, -1ULL, desc_name, -1ULL))
return 0;
return 1;
}
return -EINVAL;
}
switch (enabler->type) {
- case LTTNG_ENABLER_WILDCARD:
- return lttng_match_enabler_wildcard(desc_name, enabler_name);
+ case LTTNG_ENABLER_STAR_GLOB:
+ return lttng_match_enabler_star_glob(desc_name, enabler_name);
case LTTNG_ENABLER_NAME:
return lttng_match_enabler_name(desc_name, enabler_name);
default:
};
enum lttng_enabler_type {
- LTTNG_ENABLER_WILDCARD,
+ LTTNG_ENABLER_STAR_GLOB,
LTTNG_ENABLER_NAME,
};