trace.h (2d8ad8719591fa803b0d589ed057fa46f49b7155) trace.h (750912fa366312e9c5bc83eab352898a26750401)
1#ifndef _LINUX_KERNEL_TRACE_H
2#define _LINUX_KERNEL_TRACE_H
3
4#include <linux/fs.h>
5#include <asm/atomic.h>
6#include <linux/sched.h>
7#include <linux/clocksource.h>
8#include <linux/ring_buffer.h>

--- 592 unchanged lines hidden (view full) ---

601 TRACE_ITER_USERSTACKTRACE = 0x2000,
602 TRACE_ITER_SYM_USEROBJ = 0x4000,
603 TRACE_ITER_PRINTK_MSGONLY = 0x8000,
604 TRACE_ITER_CONTEXT_INFO = 0x10000, /* Print pid/cpu/time */
605 TRACE_ITER_LATENCY_FMT = 0x20000,
606 TRACE_ITER_SLEEP_TIME = 0x40000,
607 TRACE_ITER_GRAPH_TIME = 0x80000,
608 TRACE_ITER_RECORD_CMD = 0x100000,
1#ifndef _LINUX_KERNEL_TRACE_H
2#define _LINUX_KERNEL_TRACE_H
3
4#include <linux/fs.h>
5#include <asm/atomic.h>
6#include <linux/sched.h>
7#include <linux/clocksource.h>
8#include <linux/ring_buffer.h>

--- 592 unchanged lines hidden (view full) ---

601 TRACE_ITER_USERSTACKTRACE = 0x2000,
602 TRACE_ITER_SYM_USEROBJ = 0x4000,
603 TRACE_ITER_PRINTK_MSGONLY = 0x8000,
604 TRACE_ITER_CONTEXT_INFO = 0x10000, /* Print pid/cpu/time */
605 TRACE_ITER_LATENCY_FMT = 0x20000,
606 TRACE_ITER_SLEEP_TIME = 0x40000,
607 TRACE_ITER_GRAPH_TIME = 0x80000,
608 TRACE_ITER_RECORD_CMD = 0x100000,
609 TRACE_ITER_OVERWRITE = 0x200000,
609};
610
611/*
612 * TRACE_ITER_SYM_MASK masks the options in trace_flags that
613 * control the output of kernel symbols.
614 */
615#define TRACE_ITER_SYM_MASK \
616 (TRACE_ITER_PRINT_PARENT|TRACE_ITER_SYM_OFFSET|TRACE_ITER_SYM_ADDR)

--- 39 unchanged lines hidden (view full) ---

656 char *type;
657 int filter_type;
658 int offset;
659 int size;
660 int is_signed;
661};
662
663struct event_filter {
610};
611
612/*
613 * TRACE_ITER_SYM_MASK masks the options in trace_flags that
614 * control the output of kernel symbols.
615 */
616#define TRACE_ITER_SYM_MASK \
617 (TRACE_ITER_PRINT_PARENT|TRACE_ITER_SYM_OFFSET|TRACE_ITER_SYM_ADDR)

--- 39 unchanged lines hidden (view full) ---

657 char *type;
658 int filter_type;
659 int offset;
660 int size;
661 int is_signed;
662};
663
664struct event_filter {
664 int n_preds;
665 struct filter_pred **preds;
665 int n_preds; /* Number assigned */
666 int a_preds; /* allocated */
667 struct filter_pred *preds;
668 struct filter_pred *root;
666 char *filter_string;
667};
668
669struct event_subsystem {
670 struct list_head list;
671 const char *name;
672 struct dentry *entry;
673 struct event_filter *filter;
674 int nr_events;
675};
676
669 char *filter_string;
670};
671
672struct event_subsystem {
673 struct list_head list;
674 const char *name;
675 struct dentry *entry;
676 struct event_filter *filter;
677 int nr_events;
678};
679
680#define FILTER_PRED_INVALID ((unsigned short)-1)
681#define FILTER_PRED_IS_RIGHT (1 << 15)
682#define FILTER_PRED_FOLD (1 << 15)
683
684/*
685 * The max preds is the size of unsigned short with
686 * two flags at the MSBs. One bit is used for both the IS_RIGHT
687 * and FOLD flags. The other is reserved.
688 *
689 * 2^14 preds is way more than enough.
690 */
691#define MAX_FILTER_PRED 16384
692
677struct filter_pred;
678struct regex;
679
693struct filter_pred;
694struct regex;
695
680typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event,
681 int val1, int val2);
696typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event);
682
683typedef int (*regex_match_func)(char *str, struct regex *r, int len);
684
685enum regex_type {
686 MATCH_FULL = 0,
687 MATCH_FRONT_ONLY,
688 MATCH_MIDDLE_ONLY,
689 MATCH_END_ONLY,

--- 5 unchanged lines hidden (view full) ---

695 int field_len;
696 regex_match_func match;
697};
698
699struct filter_pred {
700 filter_pred_fn_t fn;
701 u64 val;
702 struct regex regex;
697
698typedef int (*regex_match_func)(char *str, struct regex *r, int len);
699
700enum regex_type {
701 MATCH_FULL = 0,
702 MATCH_FRONT_ONLY,
703 MATCH_MIDDLE_ONLY,
704 MATCH_END_ONLY,

--- 5 unchanged lines hidden (view full) ---

710 int field_len;
711 regex_match_func match;
712};
713
714struct filter_pred {
715 filter_pred_fn_t fn;
716 u64 val;
717 struct regex regex;
703 char *field_name;
718 /*
719 * Leaf nodes use field_name, ops is used by AND and OR
720 * nodes. The field_name is always freed when freeing a pred.
721 * We can overload field_name for ops and have it freed
722 * as well.
723 */
724 union {
725 char *field_name;
726 unsigned short *ops;
727 };
704 int offset;
705 int not;
706 int op;
728 int offset;
729 int not;
730 int op;
707 int pop_n;
731 unsigned short index;
732 unsigned short parent;
733 unsigned short left;
734 unsigned short right;
708};
709
710extern struct list_head ftrace_common_fields;
711
712extern enum regex_type
713filter_parse_regex(char *buff, int len, char **search, int *not);
714extern void print_event_filter(struct ftrace_event_call *call,
715 struct trace_seq *s);

--- 43 unchanged lines hidden ---
735};
736
737extern struct list_head ftrace_common_fields;
738
739extern enum regex_type
740filter_parse_regex(char *buff, int len, char **search, int *not);
741extern void print_event_filter(struct ftrace_event_call *call,
742 struct trace_seq *s);

--- 43 unchanged lines hidden ---