projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel-ctl: Expose kernel clear buffer operation
[lttng-tools.git]
/
src
/
common
/
kernel-ctl
/
kernel-ctl.c
diff --git
a/src/common/kernel-ctl/kernel-ctl.c
b/src/common/kernel-ctl/kernel-ctl.c
index fffa64c87dd79cdec16e53380b5ba0003b257d44..9c5ed7fd982321db33fb7252d8286622c1ce2769 100644
(file)
--- a/
src/common/kernel-ctl/kernel-ctl.c
+++ b/
src/common/kernel-ctl/kernel-ctl.c
@@
-89,10
+89,12
@@
int kernctl_create_session(int fd)
/* open the metadata global channel */
int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops)
{
/* open the metadata global channel */
int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops)
{
- struct lttng_kernel_old_channel old_channel;
struct lttng_kernel_channel channel;
if (lttng_kernel_use_old_abi) {
struct lttng_kernel_channel channel;
if (lttng_kernel_use_old_abi) {
+ struct lttng_kernel_old_channel old_channel;
+
+ memset(&old_channel, 0, sizeof(old_channel));
old_channel.overwrite = chops->overwrite;
old_channel.subbuf_size = chops->subbuf_size;
old_channel.num_subbuf = chops->num_subbuf;
old_channel.overwrite = chops->overwrite;
old_channel.subbuf_size = chops->subbuf_size;
old_channel.num_subbuf = chops->num_subbuf;
@@
-111,6
+113,7
@@
int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops)
&old_channel);
}
&old_channel);
}
+ memset(&channel, 0, sizeof(channel));
channel.overwrite = chops->overwrite;
channel.subbuf_size = chops->subbuf_size;
channel.num_subbuf = chops->num_subbuf;
channel.overwrite = chops->overwrite;
channel.subbuf_size = chops->subbuf_size;
channel.num_subbuf = chops->num_subbuf;
@@
-246,6
+249,7
@@
int kernctl_create_event(int fd, struct lttng_kernel_event *ev)
if (lttng_kernel_use_old_abi) {
struct lttng_kernel_old_event old_event;
if (lttng_kernel_use_old_abi) {
struct lttng_kernel_old_event old_event;
+ memset(&old_event, 0, sizeof(old_event));
memcpy(old_event.name, ev->name, sizeof(old_event.name));
old_event.instrumentation = ev->instrumentation;
switch (ev->instrumentation) {
memcpy(old_event.name, ev->name, sizeof(old_event.name));
old_event.instrumentation = ev->instrumentation;
switch (ev->instrumentation) {
@@
-283,6
+287,7
@@
int kernctl_add_context(int fd, struct lttng_kernel_context *ctx)
if (lttng_kernel_use_old_abi) {
struct lttng_kernel_old_context old_ctx;
if (lttng_kernel_use_old_abi) {
struct lttng_kernel_old_context old_ctx;
+ memset(&old_ctx, 0, sizeof(old_ctx));
old_ctx.ctx = ctx->ctx;
/* only type that uses the union */
if (ctx->ctx == LTTNG_KERNEL_CONTEXT_PERF_CPU_COUNTER) {
old_ctx.ctx = ctx->ctx;
/* only type that uses the union */
if (ctx->ctx == LTTNG_KERNEL_CONTEXT_PERF_CPU_COUNTER) {
@@
-345,6
+350,11
@@
int kernctl_filter(int fd, struct lttng_filter_bytecode *filter)
return ret;
}
return ret;
}
+int kernctl_add_callsite(int fd, struct lttng_kernel_event_callsite *callsite)
+{
+ return LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_ADD_CALLSITE, callsite);
+}
+
int kernctl_tracepoint_list(int fd)
{
return compat_ioctl_no_arg(fd, LTTNG_KERNEL_OLD_TRACEPOINT_LIST,
int kernctl_tracepoint_list(int fd)
{
return compat_ioctl_no_arg(fd, LTTNG_KERNEL_OLD_TRACEPOINT_LIST,
@@
-403,12
+413,26
@@
int kernctl_buffer_flush(int fd)
return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_FLUSH);
}
return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_FLUSH);
}
+int kernctl_buffer_flush_empty(int fd)
+{
+ return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_FLUSH_EMPTY);
+}
+
+int kernctl_buffer_clear(int fd)
+{
+ return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_CLEAR);
+}
+
/* returns the version of the metadata. */
int kernctl_get_metadata_version(int fd, uint64_t *version)
{
return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_GET_METADATA_VERSION, version);
}
/* returns the version of the metadata. */
int kernctl_get_metadata_version(int fd, uint64_t *version)
{
return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_GET_METADATA_VERSION, version);
}
+int kernctl_metadata_cache_dump(int fd)
+{
+ return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_METADATA_CACHE_DUMP);
+}
/* Buffer operations */
/* Buffer operations */
This page took
0.028999 seconds
and
5
git commands to generate.