struct lock_filter { int nr_types; int nr_addrs; int nr_syms; int nr_cgrps; int nr_slabs; unsignedint *types; unsignedlong *addrs; char **syms;
u64 *cgrps; char **slabs;
};
union { unsignedint nr_readlock; unsignedint flags;
}; unsignedint nr_trylock;
/* these times are in nano sec. */
u64 avg_wait_time;
u64 wait_time_total;
u64 wait_time_min;
u64 wait_time_max;
int broken; /* flag of blacklist */ int combined;
};
/* * States of lock_seq_stat * * UNINITIALIZED is required for detecting first event of acquire. * As the nature of lock events, there is no guarantee * that the first event for the locks are acquire, * it can be acquired, contended or release.
*/ #define SEQ_STATE_UNINITIALIZED 0 /* initial state */ #define SEQ_STATE_RELEASED 1 #define SEQ_STATE_ACQUIRING 2 #define SEQ_STATE_ACQUIRED 3 #define SEQ_STATE_READ_ACQUIRED 4 #define SEQ_STATE_CONTENDED 5
/* * MAX_LOCK_DEPTH * Imported from include/linux/sched.h. * Should this be synchronized?
*/ #define MAX_LOCK_DEPTH 48
/* based on kernel/lockdep.c */ #define LOCKHASH_BITS 12 #define LOCKHASH_SIZE (1UL << LOCKHASH_BITS)
externstruct hlist_head *lockhash_table;
/* * struct lock_seq_stat: * Place to put on state of one lock sequence * 1) acquire -> acquired -> release * 2) acquire -> contended -> acquired -> release * 3) acquire (with read or try) -> release * 4) Are there other patterns?
*/ struct lock_seq_stat { struct list_head list; int state;
u64 prev_event_time;
u64 addr;
int read_count;
};
struct thread_stat { struct rb_node rb;
u32 tid; struct list_head seq_list;
};
/* * CONTENTION_STACK_DEPTH * Number of stack trace entries to find callers
*/ #define CONTENTION_STACK_DEPTH 8
/* * CONTENTION_STACK_SKIP * Number of stack trace entries to skip when finding callers. * The first few entries belong to the locking implementation itself.
*/ #define CONTENTION_STACK_SKIP 4
bool match_callstack_filter(struct machine *machine, u64 *callstack, int max_stack_depth);
#ifdef HAVE_BPF_SKEL int lock_contention_prepare(struct lock_contention *con); int lock_contention_start(void); int lock_contention_stop(void); int lock_contention_read(struct lock_contention *con); int lock_contention_finish(struct lock_contention *con);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.