projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: kallsyms wrapper on ppc64el
[lttng-modules.git]
/
src
/
lttng-abi.c
diff --git
a/src/lttng-abi.c
b/src/lttng-abi.c
index cc45389403df8301fe72cd142d22615e315bacc3..9b1cceac0d99ce7bd2adc91356fc7fd64ec504bc 100644
(file)
--- a/
src/lttng-abi.c
+++ b/
src/lttng-abi.c
@@
-34,6
+34,7
@@
#include <ringbuffer/vfs.h>
#include <ringbuffer/backend.h>
#include <ringbuffer/frontend.h>
#include <ringbuffer/vfs.h>
#include <ringbuffer/backend.h>
#include <ringbuffer/frontend.h>
+#include <wrapper/compiler_attributes.h>
#include <wrapper/poll.h>
#include <wrapper/file.h>
#include <wrapper/kref.h>
#include <wrapper/poll.h>
#include <wrapper/file.h>
#include <wrapper/kref.h>
@@
-649,6
+650,8
@@
long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (validate_zeroed_padding(local_counter_read.padding,
sizeof(local_counter_read.padding)))
return -EINVAL;
if (validate_zeroed_padding(local_counter_read.padding,
sizeof(local_counter_read.padding)))
return -EINVAL;
+ if (local_counter_read.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX)
+ return -EINVAL;
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_read.index.number_dimensions; i++)
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_read.index.number_dimensions; i++)
@@
-684,6
+687,8
@@
long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (validate_zeroed_padding(local_counter_aggregate.padding,
sizeof(local_counter_aggregate.padding)))
return -EINVAL;
if (validate_zeroed_padding(local_counter_aggregate.padding,
sizeof(local_counter_aggregate.padding)))
return -EINVAL;
+ if (local_counter_aggregate.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX)
+ return -EINVAL;
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_aggregate.index.number_dimensions; i++)
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_aggregate.index.number_dimensions; i++)
@@
-715,6
+720,8
@@
long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (validate_zeroed_padding(local_counter_clear.padding,
sizeof(local_counter_clear.padding)))
return -EINVAL;
if (validate_zeroed_padding(local_counter_clear.padding,
sizeof(local_counter_clear.padding)))
return -EINVAL;
+ if (local_counter_clear.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX)
+ return -EINVAL;
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_clear.index.number_dimensions; i++)
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_clear.index.number_dimensions; i++)
@@
-723,7
+730,6
@@
long lttng_counter_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return lttng_kernel_counter_clear(counter, indexes);
}
default:
return lttng_kernel_counter_clear(counter, indexes);
}
default:
- WARN_ON_ONCE(1);
return -ENOSYS;
}
}
return -ENOSYS;
}
}
@@
-1010,7
+1016,7
@@
ssize_t lttng_event_notifier_group_notif_read(struct file *filp, char __user *us
/* Finish copy of previous record */
if (*ppos != 0) {
/* Finish copy of previous record */
if (*ppos != 0) {
- if (
read_count < count
) {
+ if (
count != 0
) {
len = chan->iter.len_left;
read_offset = *ppos;
goto skip_get_next;
len = chan->iter.len_left;
read_offset = *ppos;
goto skip_get_next;
@@
-1090,7
+1096,8
@@
nodata:
chan->iter.len_left = 0;
put_record:
chan->iter.len_left = 0;
put_record:
- lib_ring_buffer_put_current_record(buf);
+ if (*ppos == 0)
+ lib_ring_buffer_put_current_record(buf);
return read_count;
}
return read_count;
}
@@
-1332,7
+1339,8
@@
long lttng_metadata_ring_buffer_ioctl(struct file *filp,
*/
return -ENOSYS;
}
*/
return -ENOSYS;
}
- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
+ case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
{
struct lttng_metadata_stream *stream = filp->private_data;
case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
{
struct lttng_metadata_stream *stream = filp->private_data;
@@
-1441,7
+1449,8
@@
long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
*/
return -ENOSYS;
}
*/
return -ENOSYS;
}
- case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY: /* Fall-through. */
+ case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH_EMPTY:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
{
struct lttng_metadata_stream *stream = filp->private_data;
case LTTNG_KERNEL_ABI_RING_BUFFER_FLUSH:
{
struct lttng_metadata_stream *stream = filp->private_data;
@@
-1758,8
+1767,10
@@
int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param)
switch (event_param->instrumentation) {
case LTTNG_KERNEL_ABI_SYSCALL:
switch (event_param->u.syscall.entryexit) {
switch (event_param->instrumentation) {
case LTTNG_KERNEL_ABI_SYSCALL:
switch (event_param->u.syscall.entryexit) {
- case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */
- case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
break;
default:
case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
break;
default:
@@
-1783,20
+1794,26
@@
int lttng_abi_validate_event_param(struct lttng_kernel_abi_event *event_param)
switch (event_param->u.kretprobe.entryexit) {
case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
break;
switch (event_param->u.kretprobe.entryexit) {
case LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT:
break;
- case LTTNG_KERNEL_ABI_SYSCALL_ENTRY: /* Fall-through */
- case LTTNG_KERNEL_ABI_SYSCALL_EXIT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_SYSCALL_ENTRY:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_SYSCALL_EXIT:
+ lttng_fallthrough;
default:
return -EINVAL;
}
break;
default:
return -EINVAL;
}
break;
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
break;
case LTTNG_KERNEL_ABI_UPROBE:
break;
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
return -EINVAL;
}
default:
return -EINVAL;
}
@@
-1830,18
+1847,23
@@
int lttng_abi_create_event(struct file *channel_file,
}
switch (event_param->instrumentation) {
}
switch (event_param->instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
fops = <tng_event_recorder_enabler_fops;
break;
case LTTNG_KERNEL_ABI_SYSCALL:
fops = <tng_event_recorder_enabler_fops;
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
fops = <tng_event_recorder_event_fops;
break;
case LTTNG_KERNEL_ABI_UPROBE:
fops = <tng_event_recorder_event_fops;
break;
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
return -EINVAL;
}
default:
return -EINVAL;
}
@@
-1867,7
+1889,8
@@
int lttng_abi_create_event(struct file *channel_file,
goto event_error;
switch (event_param->instrumentation) {
goto event_error;
switch (event_param->instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
{
struct lttng_event_enabler *event_enabler;
case LTTNG_KERNEL_ABI_SYSCALL:
{
struct lttng_event_enabler *event_enabler;
@@
-1887,8
+1910,10
@@
int lttng_abi_create_event(struct file *channel_file,
break;
}
break;
}
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
{
struct lttng_kernel_event_recorder *event;
case LTTNG_KERNEL_ABI_UPROBE:
{
struct lttng_kernel_event_recorder *event;
@@
-1908,8
+1933,10
@@
int lttng_abi_create_event(struct file *channel_file,
break;
}
break;
}
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
ret = -EINVAL;
goto event_error;
default:
ret = -EINVAL;
goto event_error;
@@
-2043,18
+2070,23
@@
int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
}
switch (event_notifier_param->event.instrumentation) {
}
switch (event_notifier_param->event.instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
fops = <tng_event_notifier_enabler_fops;
break;
case LTTNG_KERNEL_ABI_SYSCALL:
fops = <tng_event_notifier_enabler_fops;
break;
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
fops = <tng_event_notifier_event_fops;
break;
case LTTNG_KERNEL_ABI_UPROBE:
fops = <tng_event_notifier_event_fops;
break;
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
ret = -EINVAL;
goto inval_instr;
default:
ret = -EINVAL;
goto inval_instr;
@@
-2086,7
+2118,8
@@
int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
goto event_notifier_error;
switch (event_notifier_param->event.instrumentation) {
goto event_notifier_error;
switch (event_notifier_param->event.instrumentation) {
- case LTTNG_KERNEL_ABI_TRACEPOINT: /* Fall-through */
+ case LTTNG_KERNEL_ABI_TRACEPOINT:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
{
struct lttng_event_notifier_enabler *enabler;
case LTTNG_KERNEL_ABI_SYSCALL:
{
struct lttng_event_notifier_enabler *enabler;
@@
-2110,8
+2143,10
@@
int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
break;
}
break;
}
- case LTTNG_KERNEL_ABI_KPROBE: /* Fall-through */
- case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
+ case LTTNG_KERNEL_ABI_KPROBE:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_KRETPROBE:
+ lttng_fallthrough;
case LTTNG_KERNEL_ABI_UPROBE:
{
struct lttng_kernel_event_notifier *event_notifier;
case LTTNG_KERNEL_ABI_UPROBE:
{
struct lttng_kernel_event_notifier *event_notifier;
@@
-2135,8
+2170,10
@@
int lttng_abi_create_event_notifier(struct file *event_notifier_group_file,
break;
}
break;
}
- case LTTNG_KERNEL_ABI_FUNCTION: /* Fall-through */
- case LTTNG_KERNEL_ABI_NOOP: /* Fall-through */
+ case LTTNG_KERNEL_ABI_FUNCTION:
+ lttng_fallthrough;
+ case LTTNG_KERNEL_ABI_NOOP:
+ lttng_fallthrough;
default:
ret = -EINVAL;
goto event_notifier_error;
default:
ret = -EINVAL;
goto event_notifier_error;
This page took
0.033755 seconds
and
4
git commands to generate.