]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
GFS2: Add origin indicator to glock demote tracing
authorSteven Whitehouse <swhiteho@redhat.com>
Wed, 10 Apr 2013 09:32:05 +0000 (10:32 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 10 Apr 2013 09:32:05 +0000 (10:32 +0100)
This adds the origin indicator to the trace point for glock
demotion, so that it is possible to see where demote requests
have come from.

Note that requests generated from the demote_rq sysfs interface
will show as remote, since they are intended to replicate
exactly the effect of a demote reuqest from a remote node. It
is still possible to tell these apart by looking at the process
which initiated the demote request.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/glock.c
fs/gfs2/trace_gfs2.h

index 77d7927bcd753429eddb699ba5f561dbe87fcf6c..3b9e1788ebf918c23139656166e6e007bab59b98 100644 (file)
@@ -926,7 +926,7 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state,
        }
        if (gl->gl_ops->go_callback)
                gl->gl_ops->go_callback(gl, remote);
-       trace_gfs2_demote_rq(gl);
+       trace_gfs2_demote_rq(gl, remote);
 }
 
 void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...)
index 2ee13e841e9f6268f2be1efd4a6920eb3972ab72..20c007d747ab2cd9b2d53eb5cd4bbb69ebbc361f 100644 (file)
@@ -159,9 +159,9 @@ TRACE_EVENT(gfs2_glock_put,
 /* Callback (local or remote) requesting lock demotion */
 TRACE_EVENT(gfs2_demote_rq,
 
-       TP_PROTO(const struct gfs2_glock *gl),
+       TP_PROTO(const struct gfs2_glock *gl, bool remote),
 
-       TP_ARGS(gl),
+       TP_ARGS(gl, remote),
 
        TP_STRUCT__entry(
                __field(        dev_t,  dev                     )
@@ -170,6 +170,7 @@ TRACE_EVENT(gfs2_demote_rq,
                __field(        u8,     cur_state               )
                __field(        u8,     dmt_state               )
                __field(        unsigned long,  flags           )
+               __field(        bool,   remote                  )
        ),
 
        TP_fast_assign(
@@ -179,14 +180,16 @@ TRACE_EVENT(gfs2_demote_rq,
                __entry->cur_state      = glock_trace_state(gl->gl_state);
                __entry->dmt_state      = glock_trace_state(gl->gl_demote_state);
                __entry->flags          = gl->gl_flags  | (gl->gl_object ? (1UL<<GLF_OBJECT) : 0);
+               __entry->remote         = remote;
        ),
 
-       TP_printk("%u,%u glock %d:%lld demote %s to %s flags:%s",
+       TP_printk("%u,%u glock %d:%lld demote %s to %s flags:%s %s",
                  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->gltype,
                  (unsigned long long)__entry->glnum,
                   glock_trace_name(__entry->cur_state),
                   glock_trace_name(__entry->dmt_state),
-                 show_glock_flags(__entry->flags))
+                 show_glock_flags(__entry->flags),
+                 __entry->remote ? "remote" : "local")
 
 );