26
26
#define MAX_TAIL_CALLS 10
27
27
// Maximum number of frames.
28
28
#define MAX_STACK_DEPTH 127
29
- _Static_assert (MAX_TAIL_CALLS * MAX_STACK_DEPTH_PER_PROGRAM >= MAX_STACK_DEPTH , "Not enough iterations to traverse the whole stack" );
29
+ _Static_assert (MAX_TAIL_CALLS * MAX_STACK_DEPTH_PER_PROGRAM >= MAX_STACK_DEPTH , "enough iterations to traverse the whole stack" );
30
30
// Number of unique stacks.
31
31
#define MAX_STACK_TRACES_ENTRIES 64000
32
32
// Number of items in the stack counts aggregation map.
@@ -39,7 +39,7 @@ _Static_assert(MAX_TAIL_CALLS *MAX_STACK_DEPTH_PER_PROGRAM >= MAX_STACK_DEPTH, "
39
39
// Size of the unwind table.
40
40
// 250k * sizeof(stack_unwind_row_t) = 2MB
41
41
#define MAX_UNWIND_TABLE_SIZE 250 * 1000
42
- _Static_assert (1 << MAX_BINARY_SEARCH_DEPTH >= MAX_UNWIND_TABLE_SIZE , "Unwind table too small " );
42
+ _Static_assert (1 << MAX_BINARY_SEARCH_DEPTH >= MAX_UNWIND_TABLE_SIZE , "unwind table is big enough " );
43
43
44
44
// Unwind tables bigger than can't fit in the remaining space
45
45
// of the current shard are broken up into chunks up to `MAX_UNWIND_TABLE_SIZE`.
@@ -180,15 +180,15 @@ typedef struct {
180
180
stack_trace_t stack ;
181
181
} unwind_state_t ;
182
182
183
- // A row in the stack unwinding table.
184
- typedef struct stack_unwind_row {
183
+ // A row in the stack unwinding table for x86_64 .
184
+ typedef struct __attribute__(( packed )) {
185
185
u64 pc ;
186
- u16 __reserved_do_not_use ;
187
186
u8 cfa_type ;
188
187
u8 rbp_type ;
189
188
s16 cfa_offset ;
190
189
s16 rbp_offset ;
191
190
} stack_unwind_row_t ;
191
+ _Static_assert (sizeof (stack_unwind_row_t ) == 14 , "unwind row has the expected size" );
192
192
193
193
// Unwinding table representation.
194
194
typedef struct stack_unwind_table {
0 commit comments