Remove immediate values code (non-effective anyway)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Apr 2011 19:57:39 +0000 (15:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Apr 2011 19:57:39 +0000 (15:57 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/Makefile.am
include/ust/immediate.h [deleted file]
include/ust/marker.h
include/ust/tracepoint.h
include/ust/ust.h
libust/marker.c
libust/tracectl.c
libust/tracepoint.c

index e703ffd094949eaf8c60b7b50d82576c5052170b..2133efdc7f0a0b51b95de847e42862c7e1a6e1bb 100644 (file)
@@ -1,5 +1,4 @@
 nobase_include_HEADERS = \
-       ust/immediate.h \
        ust/marker.h \
        ust/tracepoint.h \
        ust/define_trace.h \
diff --git a/include/ust/immediate.h b/include/ust/immediate.h
deleted file mode 100644 (file)
index 1b117cf..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef _LINUX_IMMEDIATE_H
-#define _LINUX_IMMEDIATE_H
-
-/*
- * Immediate values, can be updated at runtime and save cache lines.
- *
- * (C) Copyright 2007 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
- *
- * 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * 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
- */
-
-#ifdef USE_IMMEDIATE
-
-#include <asm/immediate.h>
-
-/**
- * imv_set - set immediate variable (with locking)
- * @name: immediate value name
- * @i: required value
- *
- * Sets the value of @name, taking the module_mutex if required by
- * the architecture.
- */
-#define imv_set(name, i)                                               \
-       do {                                                            \
-               name##__imv = (i);                                      \
-               core_imv_update();                                      \
-               module_imv_update();                                    \
-       } while (0)
-
-/*
- * Internal update functions.
- */
-extern void core_imv_update(void);
-extern void imv_update_range(const struct __imv *begin,
-       const struct __imv *end);
-extern void imv_unref_core_init(void);
-extern void imv_unref(struct __imv *begin, struct __imv *end, void *start,
-               unsigned long size);
-
-#else
-
-/*
- * Generic immediate values: a simple, standard, memory load.
- */
-
-/**
- * imv_read - read immediate variable
- * @name: immediate value name
- *
- * Reads the value of @name.
- */
-#define imv_read(name)                 _imv_read(name)
-
-/**
- * imv_set - set immediate variable (with locking)
- * @name: immediate value name
- * @i: required value
- *
- * Sets the value of @name, taking the module_mutex if required by
- * the architecture.
- */
-#define imv_set(name, i)               (name##__imv = (i))
-
-static inline void core_imv_update(void) { }
-static inline void imv_unref_core_init(void) { }
-
-#endif
-
-#define DECLARE_IMV(type, name) extern __typeof__(type) name##__imv
-#define DEFINE_IMV(type, name)  __typeof__(type) name##__imv
-
-#define EXPORT_IMV_SYMBOL(name) EXPORT_SYMBOL(name##__imv)
-#define EXPORT_IMV_SYMBOL_GPL(name) EXPORT_SYMBOL_GPL(name##__imv)
-
-/**
- * _imv_read - Read immediate value with standard memory load.
- * @name: immediate value name
- *
- * Force a data read of the immediate value instead of the immediate value
- * based mechanism. Useful for __init and __exit section data read.
- */
-#define _imv_read(name)                (name##__imv)
-
-#endif
index 99bb724cb789b3d0e429f7b65863725917266dd2..13d81040c91d3b3edd910bf683d171bcceca908d 100644 (file)
@@ -25,7 +25,6 @@
 #define _UST_MARKER_H
 
 #include <stdarg.h>
-#include <ust/immediate.h>
 #include <ust/core.h>
 #include <urcu/list.h>
 #include <ust/processor.h>
@@ -64,7 +63,7 @@ struct ust_marker {
        const char *format;     /* Marker format string, describing the
                                 * variable argument list.
                                 */
-       DEFINE_IMV(char, state);/* Immediate value state. */
+       char state;             /* State. */
        char ptype;             /* probe type : 0 : single, 1 : multi */
                                /* Probe wrapper */
        u16 channel_id;         /* Numeric channel identifier, dynamic */
@@ -161,27 +160,18 @@ struct ust_marker {
  * Make sure the alignment of the structure in the __ust_marker section will
  * not add unwanted padding between the beginning of the section and the
  * structure. Force alignment to the same alignment as the section start.
- *
- * The "generic" argument controls which marker enabling mechanism must be used.
- * If generic is true, a variable read is used.
- * If generic is false, immediate values are used.
  */
 
-#define __ust_marker(generic, channel, name, call_private, format, args...) \
-       __ust_marker_counter(generic, channel, name, __LINE__, call_private, format, ## args)
+#define __ust_marker(channel, name, call_private, format, args...) \
+       __ust_marker_counter(channel, name, __LINE__, call_private, format, ## args)
 
-#define __ust_marker_counter(generic, channel, name, unique, call_private, format, args...) \
+#define __ust_marker_counter(channel, name, unique, call_private, format, args...) \
        do {                                                            \
                struct ust_marker *__ust_marker_counter_ptr;                    \
                _DEFINE_UST_MARKER(channel, name, NULL, NULL, format, unique, __ust_marker_counter_ptr);        \
                __ust_marker_check_format(format, ## args);             \
-               if (!generic) {                                         \
-                       if (unlikely(imv_read(__ust_marker_counter_ptr->state))) \
-                               (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args);  \
-               } else {                                                \
-                       if (unlikely(_imv_read(__ust_marker_counter_ptr->state))) \
-                               (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args);          \
-               }                                                       \
+               if (unlikely(__ust_marker_counter_ptr->state)) \
+                       (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args);          \
        } while (0)
 
 #define __ust_marker_tp(channel, name, call_private, tp_name, tp_cb, format, args...) \
@@ -209,24 +199,10 @@ extern void ust_marker_update_probe_range(struct ust_marker * const *begin,
  * @format: format string
  * @args...: variable argument list
  *
- * Places a marker using optimized code patching technique (imv_read())
- * to be enabled when immediate values are present.
+ * Places a marker at caller site.
  */
 #define ust_marker(name, format, args...) \
-       __ust_marker(0, ust, name, NULL, format, ## args)
-
-/**
- * _ust_marker - Marker using variable read
- * @name: marker name, not quoted.
- * @format: format string
- * @args...: variable argument list
- *
- * Places a marker using a standard memory read (_imv_read()) to be
- * enabled. Should be used for markers in code paths where instruction
- * modification based enabling is not welcome.
- */
-#define _ust_marker(name, format, args...) \
-       __ust_marker(1, ust, name, NULL, format, ## args)
+       __ust_marker(ust, name, NULL, format, ## args)
 
 /**
  * ust_marker_tp - Marker in a tracepoint callback
index 626f8af545dfea3d9c5136503ad7a61c44fae6ef..34272053947bcc7017bb73d1ea25eb47762a16da 100644 (file)
@@ -27,7 +27,6 @@
 
 #define _LGPL_SOURCE
 #include <urcu-bp.h>
-#include <ust/immediate.h>
 #include <ust/core.h>
 
 struct module;
@@ -40,7 +39,7 @@ struct probe {
 
 struct tracepoint {
        const char *name;               /* Tracepoint name */
-       DEFINE_IMV(char, state);        /* State. */
+       char state;                     /* State. */
        struct probe *probes;
 };
 
@@ -86,39 +85,23 @@ struct tracepoint {
                rcu_read_unlock();                                      \
        } while (0)
 
-#define __CHECK_TRACE(name, generic, proto, args)                      \
+#define __CHECK_TRACE(name, proto, args)                               \
        do {                                                            \
-               if (!generic) {                                         \
-                       if (unlikely(imv_read(__tracepoint_##name.state))) \
-                               __DO_TRACE(&__tracepoint_##name,        \
-                                       TP_PROTO(proto), TP_ARGS(args));        \
-               } else {                                                \
-                       if (unlikely(_imv_read(__tracepoint_##name.state))) \
-                               __DO_TRACE(&__tracepoint_##name,        \
-                                       TP_PROTO(proto), TP_ARGS(args));        \
-               }                                                       \
+               if (unlikely(__tracepoint_##name.state))                \
+                       __DO_TRACE(&__tracepoint_##name,                \
+                               TP_PROTO(proto), TP_ARGS(args));        \
        } while (0)
 
 /*
  * Make sure the alignment of the structure in the __tracepoints section will
  * not add unwanted padding between the beginning of the section and the
  * structure. Force alignment to the same alignment as the section start.
- *
- * The "generic" argument, passed to the declared __trace_##name inline
- * function controls which tracepoint enabling mechanism must be used.
- * If generic is true, a variable read is used.
- * If generic is false, immediate values are used.
  */
 #define __DECLARE_TRACE(name, proto, args, data_proto, data_args)      \
        extern struct tracepoint __tracepoint_##name;                   \
        static inline void __trace_##name(proto)                        \
        {                                                               \
-               __CHECK_TRACE(name, 0, TP_PROTO(data_proto),            \
-                             TP_ARGS(data_args));                      \
-       }                                                               \
-       static inline void _trace_##name(proto)                         \
-       {                                                               \
-               __CHECK_TRACE(name, 1, TP_PROTO(data_proto),            \
+               __CHECK_TRACE(name, TP_PROTO(data_proto),               \
                              TP_ARGS(data_args));                      \
        }                                                               \
        static inline int                                               \
index d99a706a842647bf0e0cbc6f935388df81f219a5..0c7e83fbb1b6f112773fdb199044c577c35ca181 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef UST_H
 #define UST_H
 
-#include <ust/immediate.h>
 #include <ust/marker.h>
 #include <ust/processor.h>
 #include <ust/tracepoint.h>
index 4a7eec63c992dbbcfe192cac35590929c3535c39..ef60639897e3858477193053e15eaebb6a26ee3d 100644 (file)
@@ -448,7 +448,7 @@ static struct ust_marker_entry *add_ust_marker(const char *channel, const char *
                        e->call = ust_marker_probe_cb_noarg;
                else
                        e->call = ust_marker_probe_cb;
-               __ust_marker(0, metadata, core_marker_format, NULL,
+               __ust_marker(metadata, core_marker_format, NULL,
                           "channel %s name %s format %s",
                           e->channel, e->name, e->format);
        } else {
@@ -515,7 +515,7 @@ static int ust_marker_set_format(struct ust_marker_entry *entry, const char *for
                return -ENOMEM;
        entry->format_allocated = 1;
 
-       __ust_marker(0, metadata, core_marker_format, NULL,
+       __ust_marker(metadata, core_marker_format, NULL,
                   "channel %s name %s format %s",
                   entry->channel, entry->name, entry->format);
        return 0;
@@ -580,7 +580,7 @@ static int set_ust_marker(struct ust_marker_entry *entry, struct ust_marker *ele
        cmm_smp_wmb();
        elem->ptype = entry->ptype;
 
-       if (elem->tp_name && (active ^ _imv_read(elem->state))) {
+       if (elem->tp_name && (active ^ elem->state)) {
                WARN_ON(!elem->tp_cb);
                /*
                 * It is ok to directly call the probe registration because type
@@ -610,7 +610,7 @@ static int set_ust_marker(struct ust_marker_entry *entry, struct ust_marker *ele
 //ust//                                (unsigned long)elem->tp_cb));
                }
        }
-       elem->state__imv = active;
+       elem->state = active;
 
        return ret;
 }
@@ -626,7 +626,7 @@ static void disable_ust_marker(struct ust_marker *elem)
        int ret;
 
        /* leave "call" as is. It is known statically. */
-       if (elem->tp_name && _imv_read(elem->state)) {
+       if (elem->tp_name && elem->state) {
                WARN_ON(!elem->tp_cb);
                /*
                 * It is ok to directly call the probe registration because type
@@ -641,7 +641,7 @@ static void disable_ust_marker(struct ust_marker *elem)
                 */
 //ust//                module_put(__module_text_address((unsigned long)elem->tp_cb));
        }
-       elem->state__imv = 0;
+       elem->state = 0;
        elem->single.func = __ust_marker_empty_function;
        /* Update the function before setting the ptype */
        cmm_smp_wmb();
@@ -734,9 +734,6 @@ static void ust_marker_update_probes(void)
 {
        lib_update_ust_marker();
        tracepoint_probe_update_all();
-       /* Update immediate values */
-       core_imv_update();
-//ust//        module_imv_update(); /* FIXME: need to port for libs? */
        ust_marker_update_processes();
 }
 
@@ -782,7 +779,7 @@ int ust_marker_probe_register(const char *channel, const char *name,
                        goto error_unregister_channel;
                entry->event_id = ret;
                ret = 0;
-               __ust_marker(0, metadata, core_marker_id, NULL,
+               __ust_marker(metadata, core_marker_id, NULL,
                           "channel %s name %s event_id %hu "
                           "int #1u%zu long #1u%zu pointer #1u%zu "
                           "size_t #1u%zu alignment #1u%u",
@@ -1297,7 +1294,7 @@ void ltt_dump_ust_marker_state(struct ust_trace *trace)
        for (i = 0; i < ust_marker_TABLE_SIZE; i++) {
                head = &ust_marker_table[i];
                cds_hlist_for_each_entry(entry, node, head, hlist) {
-                       __ust_marker(0, metadata, core_marker_id,
+                       __ust_marker(metadata, core_marker_id,
                                &call_data,
                                "channel %s name %s event_id %hu "
                                "int #1u%zu long #1u%zu pointer #1u%zu "
@@ -1309,7 +1306,7 @@ void ltt_dump_ust_marker_state(struct ust_trace *trace)
                                sizeof(void *), sizeof(size_t),
                                ltt_get_alignment());
                        if (entry->format)
-                               __ust_marker(0, metadata,
+                               __ust_marker(metadata,
                                        core_marker_format,
                                        &call_data,
                                        "channel %s name %s format %s",
index 414162c1df96ad0a03586496a10bfce7d6113dc0..9634f2270d58790cf088ef69e39b63e664ca5956 100644 (file)
@@ -110,7 +110,7 @@ static void print_ust_marker(FILE *fp)
                fprintf(fp, "ust_marker: %s/%s %d \"%s\" %p\n",
                        (*iter.ust_marker)->channel,
                        (*iter.ust_marker)->name,
-                       (int)imv_read((*iter.ust_marker)->state),
+                       (int)(*iter.ust_marker)->state,
                        (*iter.ust_marker)->format,
                        (*iter.ust_marker)->location);
                ust_marker_iter_next(&iter);
index a1aac8264e255d85beeefe7a3472adc378bc4c6f..87e53cc920664fffff09e79402239ed89050f11d 100644 (file)
@@ -265,7 +265,7 @@ static void set_tracepoint(struct tracepoint_entry **entry,
         * is used.
         */
        rcu_assign_pointer(elem->probes, (*entry)->probes);
-       elem->state__imv = active;
+       elem->state = active;
 }
 
 /*
@@ -276,7 +276,7 @@ static void set_tracepoint(struct tracepoint_entry **entry,
  */
 static void disable_tracepoint(struct tracepoint *elem)
 {
-       elem->state__imv = 0;
+       elem->state = 0;
        rcu_assign_pointer(elem->probes, NULL);
 }
 
@@ -333,9 +333,6 @@ static void tracepoint_update_probes(void)
 //ust//                __stop___tracepoints);
        /* tracepoints in modules. */
        lib_update_tracepoints();
-       /* Update immediate values */
-       core_imv_update();
-//ust//        module_imv_update();
 }
 
 static struct probe *
This page took 0.030495 seconds and 4 git commands to generate.