1 #ifndef _RUNTIME_INSTR_H
2 #define _RUNTIME_INSTR_H
4 #define S390_RUNTIME_INSTR_START 0x1
5 #define S390_RUNTIME_INSTR_STOP 0x2
7 struct runtime_instr_cb
{
14 __u32 pstate_set_buf
: 1;
18 __u32 pstate_sample
: 1;
19 __u32 sstate_sample
: 1;
20 __u32 pstate_collect
: 1;
21 __u32 sstate_collect
: 1;
24 __u32 int_requested
: 1;
25 __u32 buffer_full_int
: 1;
34 __u32 call_type_br
: 1;
35 __u32 return_type_br
: 1;
36 __u32 other_type_br
: 1;
37 __u32 bc_other_type
: 1;
48 __u32 dc_miss_extra
: 1;
49 __u32 lat_lev_ignore
: 1;
57 } __packed
__aligned(8);
59 extern struct runtime_instr_cb runtime_instr_empty_cb
;
61 static inline void load_runtime_instr_cb(struct runtime_instr_cb
*cb
)
63 asm volatile(".insn rsy,0xeb0000000060,0,0,%0" /* LRIC */
67 static inline void store_runtime_instr_cb(struct runtime_instr_cb
*cb
)
69 asm volatile(".insn rsy,0xeb0000000061,0,0,%0" /* STRIC */
70 : "=Q" (*cb
) : : "cc");
73 static inline void save_ri_cb(struct runtime_instr_cb
*cb_prev
)
77 store_runtime_instr_cb(cb_prev
);
81 static inline void restore_ri_cb(struct runtime_instr_cb
*cb_next
,
82 struct runtime_instr_cb
*cb_prev
)
86 load_runtime_instr_cb(cb_next
);
88 load_runtime_instr_cb(&runtime_instr_empty_cb
);
93 extern void exit_thread_runtime_instr(void);
95 static inline void exit_thread_runtime_instr(void) { }
98 #endif /* _RUNTIME_INSTR_H */