Do not use an anonymous string literal with a non-const char pointer as
this will discard the implicit const, use static non-const string
instead when appropriate. Otherwise, we could end up trying to write to
a string constant.
Change-Id: Ie2bb0e5ab7978930f9edcdb379bd181caaacc15c
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* TP_ARGS() is valid to mean no arguments
* TP_ARGS( void ) is valid too
*/
* TP_ARGS() is valid to mean no arguments
* TP_ARGS( void ) is valid too
*/
+ TP_ARGS(const char *, text),
/*
* TP_FIELDS describes how to write the fields of the trace event.
* You can use the args here
/*
* TP_FIELDS describes how to write the fields of the trace event.
* You can use the args here
TRACEPOINT_EVENT(
sample_tracepoint,
message, // C++ Style comment
TRACEPOINT_EVENT(
sample_tracepoint,
message, // C++ Style comment
+ TP_ARGS(const char *, text),
TP_FIELDS(
ctf_string(message, text)
)
TP_FIELDS(
ctf_string(message, text)
)
static DEFINE_URCU_TLS(int, procname_nesting);
static inline
static DEFINE_URCU_TLS(int, procname_nesting);
static inline
-char *wrapper_getprocname(void)
+const char *wrapper_getprocname(void)
{
int nesting = CMM_LOAD_SHARED(URCU_TLS(procname_nesting));
{
int nesting = CMM_LOAD_SHARED(URCU_TLS(procname_nesting));
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_ust_channel_buffer *chan)
{
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_ust_channel_buffer *chan)
{
procname = wrapper_getprocname();
chan->ops->event_write(ctx, procname, LTTNG_UST_ABI_PROCNAME_LEN, 1);
procname = wrapper_getprocname();
chan->ops->event_write(ctx, procname, LTTNG_UST_ABI_PROCNAME_LEN, 1);
};
struct lttng_transport {
};
struct lttng_transport {
struct cds_list_head node;
struct lttng_ust_channel_buffer_ops ops;
const struct lttng_ust_lib_ring_buffer_config *client_config;
};
struct lttng_counter_transport {
struct cds_list_head node;
struct lttng_ust_channel_buffer_ops ops;
const struct lttng_ust_lib_ring_buffer_config *client_config;
};
struct lttng_counter_transport {
struct cds_list_head node;
struct lttng_counter_ops ops;
const struct lib_counter_config *client_config;
struct cds_list_head node;
struct lttng_counter_ops ops;
const struct lib_counter_config *client_config;
#include "fvwrite.h"
#include "various.h"
#include "fvwrite.h"
#include "various.h"
+static char null_str[] = "(null)";
+static char bad_base_str[] = "bug in ust_safe_vfprintf: bad base";
+
union arg {
int intarg;
unsigned int uintarg;
union arg {
int intarg;
unsigned int uintarg;
goto nosign;
case 's':
if ((cp = GETARG(char *)) == NULL)
goto nosign;
case 's':
if ((cp = GETARG(char *)) == NULL)
if (prec >= 0) {
/*
* can't use strlen; can only look for the
if (prec >= 0) {
/*
* can't use strlen; can only look for the
- cp = "bug in ust_safe_vfprintf: bad base";
size = strlen(cp);
goto skipsize;
}
size = strlen(cp);
goto skipsize;
}
+static char myprovider_name[] = "$app.myprovider";
struct lttng_ust_context_provider myprovider = {
.struct_size = sizeof(struct lttng_ust_context_provider),
struct lttng_ust_context_provider myprovider = {
.struct_size = sizeof(struct lttng_ust_context_provider),
- .name = "$app.myprovider",
+ .name = myprovider_name,
.get_size = test_get_size,
.record = test_record,
.get_value = test_get_value,
.get_size = test_get_size,
.record = test_record,
.get_value = test_get_value,