Fix: introduce LTTNG_SIZE_MAX for older kernels
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 11 Mar 2017 18:46:10 +0000 (13:46 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 11 Mar 2017 18:46:10 +0000 (13:46 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-events.c
lttng-filter-interpreter.c
wrapper/types.h [new file with mode: 0644]

index 95a79cf75dc10de27daf335b927043f9231bfa29..6aa994ca0925f38fd56d04c43c4937f0cf93a783 100644 (file)
@@ -46,6 +46,7 @@
 #include <wrapper/random.h>
 #include <wrapper/tracepoint.h>
 #include <wrapper/list.h>
+#include <wrapper/types.h>
 #include <lttng-kernel-version.h>
 #include <lttng-events.h>
 #include <lttng-tracer.h>
@@ -1146,7 +1147,8 @@ static
 int lttng_match_enabler_star_glob(const char *desc_name,
                const char *pattern)
 {
-       if (!strutils_star_glob_match(pattern, SIZE_MAX, desc_name, SIZE_MAX))
+       if (!strutils_star_glob_match(pattern, LTTNG_SIZE_MAX,
+                       desc_name, LTTNG_SIZE_MAX))
                return 0;
        return 1;
 }
index f4d5a94674cb134731cb8c764b627e9a35dd758a..e13146241ae36e4631d27319513b8f055b5194ca 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <linux/uaccess.h>
 #include <wrapper/frame.h>
+#include <wrapper/types.h>
 
 #include <lttng-filter.h>
 #include <lttng-string-utils.h>
@@ -726,7 +727,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data,
                                ret = -EINVAL;
                                goto end;
                        }
-                       estack_ax(stack, top)->u.s.seq_len = SIZE_MAX;
+                       estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX;
                        estack_ax(stack, top)->u.s.literal_type =
                                ESTACK_STRING_LITERAL_TYPE_NONE;
                        estack_ax(stack, top)->u.s.user = 0;
@@ -790,7 +791,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data,
                        dbg_printk("load string %s\n", insn->data);
                        estack_push(stack, top, ax, bx);
                        estack_ax(stack, top)->u.s.str = insn->data;
-                       estack_ax(stack, top)->u.s.seq_len = SIZE_MAX;
+                       estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX;
                        estack_ax(stack, top)->u.s.literal_type =
                                ESTACK_STRING_LITERAL_TYPE_PLAIN;
                        estack_ax(stack, top)->u.s.user = 0;
@@ -805,7 +806,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data,
                        dbg_printk("load globbing pattern %s\n", insn->data);
                        estack_push(stack, top, ax, bx);
                        estack_ax(stack, top)->u.s.str = insn->data;
-                       estack_ax(stack, top)->u.s.seq_len = SIZE_MAX;
+                       estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX;
                        estack_ax(stack, top)->u.s.literal_type =
                                ESTACK_STRING_LITERAL_TYPE_STAR_GLOB;
                        estack_ax(stack, top)->u.s.user = 0;
@@ -870,7 +871,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data,
                                ret = -EINVAL;
                                goto end;
                        }
-                       estack_ax(stack, top)->u.s.seq_len = SIZE_MAX;
+                       estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX;
                        estack_ax(stack, top)->u.s.literal_type =
                                ESTACK_STRING_LITERAL_TYPE_NONE;
                        estack_ax(stack, top)->u.s.user = 0;
@@ -920,7 +921,7 @@ uint64_t lttng_filter_interpret_bytecode(void *filter_data,
                                ret = -EINVAL;
                                goto end;
                        }
-                       estack_ax(stack, top)->u.s.seq_len = SIZE_MAX;
+                       estack_ax(stack, top)->u.s.seq_len = LTTNG_SIZE_MAX;
                        estack_ax(stack, top)->u.s.literal_type =
                                ESTACK_STRING_LITERAL_TYPE_NONE;
                        estack_ax(stack, top)->u.s.user = 1;
diff --git a/wrapper/types.h b/wrapper/types.h
new file mode 100644 (file)
index 0000000..556a67c
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef _LTTNG_WRAPPER_TYPES_H
+#define _LTTNG_WRAPPER_TYPES_H
+
+/*
+ * wrapper/types.h
+ *
+ * Copyright (C) 2017 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; only
+ * version 2.1 of the License.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define LTTNG_SIZE_MAX (~(size_t)0)
+
+#endif /* _LTTNG_WRAPPER_TYPES_H */
This page took 0.031957 seconds and 4 git commands to generate.