projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring: kprobes: combine common code between recorder and notifier
[lttng-modules.git]
/
src
/
probes
/
lttng-kretprobes.c
diff --git
a/src/probes/lttng-kretprobes.c
b/src/probes/lttng-kretprobes.c
index 7d0db416908f6ba95ff21600d115374a6f9dc477..1d0a5ecbe6563c0a17df4b0f50794ad0cc921571 100644
(file)
--- a/
src/probes/lttng-kretprobes.c
+++ b/
src/probes/lttng-kretprobes.c
@@
-14,6
+14,7
@@
#include <lttng/events.h>
#include <lttng/events-internal.h>
#include <ringbuffer/frontend_types.h>
#include <lttng/events.h>
#include <lttng/events-internal.h>
#include <ringbuffer/frontend_types.h>
+#include <wrapper/compiler_attributes.h>
#include <wrapper/vmalloc.h>
#include <wrapper/irqflags.h>
#include <lttng/tracer.h>
#include <wrapper/vmalloc.h>
#include <wrapper/irqflags.h>
#include <lttng/tracer.h>
@@
-53,15
+54,16
@@
int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
{
struct lttng_kernel_event_recorder *event_recorder =
container_of(event, struct lttng_kernel_event_recorder, parent);
{
struct lttng_kernel_event_recorder *event_recorder =
container_of(event, struct lttng_kernel_event_recorder, parent);
- struct lttng_
channel
*chan = event_recorder->chan;
+ struct lttng_
kernel_channel_buffer
*chan = event_recorder->chan;
- if (unlikely(!LTTNG_READ_ONCE(chan->session->active)))
+ if (unlikely(!LTTNG_READ_ONCE(chan->
parent.
session->active)))
return 0;
return 0;
- if (unlikely(!LTTNG_READ_ONCE(chan->enabled)))
+ if (unlikely(!LTTNG_READ_ONCE(chan->
parent.
enabled)))
return 0;
break;
}
return 0;
break;
}
- case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */
+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
}
default:
WARN_ON_ONCE(1);
}
@@
-74,7
+76,7
@@
int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
{
struct lttng_kernel_event_recorder *event_recorder =
container_of(event, struct lttng_kernel_event_recorder, parent);
{
struct lttng_kernel_event_recorder *event_recorder =
container_of(event, struct lttng_kernel_event_recorder, parent);
- struct lttng_
channel
*chan = event_recorder->chan;
+ struct lttng_
kernel_channel_buffer
*chan = event_recorder->chan;
struct lttng_kernel_ring_buffer_ctx ctx;
int ret;
struct lttng_kernel_ring_buffer_ctx ctx;
int ret;
@@
-86,12
+88,12
@@
int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
ret = chan->ops->event_reserve(&ctx);
if (ret < 0)
return 0;
ret = chan->ops->event_reserve(&ctx);
if (ret < 0)
return 0;
- lib_ring_buffer_align_ctx(&ctx, lttng_alignof(payload));
- chan->ops->event_write(&ctx, &payload, sizeof(payload));
+ chan->ops->event_write(&ctx, &payload, sizeof(payload), lttng_alignof(payload));
chan->ops->event_commit(&ctx);
break;
}
chan->ops->event_commit(&ctx);
break;
}
- case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */
+ case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER:
+ lttng_fallthrough;
default:
WARN_ON_ONCE(1);
}
default:
WARN_ON_ONCE(1);
}
This page took
0.044513 seconds
and
4
git commands to generate.