Skip to content

Commit 6cbe0a9

Browse files
committed
Decrease BPFTRACE_MAX_STRLEN back down to 64
We missed two cases where big strings will break things. See included runtime tests. Both fail when BPFTRACE_MAX_STRLEN is 1024. Decrease the default until we fix this.
1 parent 690febe commit 6cbe0a9

16 files changed

+86
-47
lines changed

.github/include/aot_skip.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ aot.call.print_map_item_tuple
2424
aot.call.print_non_map_builtin
2525
aot.call.print_non_map_struct_kfunc
2626
aot.call.print_non_map_tuple
27+
# Same problem as #3392
28+
aot.call.str_big_tuple
2729
aot.call.str_truncated
2830
aot.call.str_truncated_custom
2931
aot.call.strftime

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ and this project adheres to
3434
- [#3249](https://github.com/bpftrace/bpftrace/pull/3249)
3535
- Faster map access for keyless maps by using BPF_MAP_TYPE_ARRAY
3636
- [#3300](https://github.com/bpftrace/bpftrace/pull/3300)
37-
- Increase default string size from 64 to 1024
38-
- [#3371](https://github.com/bpftrace/bpftrace/pull/3371)
3937
#### Deprecated
4038
#### Removed
4139
- Remove the `-dd` CLI option

man/adoc/bpftrace.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3443,7 +3443,7 @@ system.
34433443

34443444
=== max_strlen
34453445

3446-
Default: 1024
3446+
Default: 64
34473447

34483448
The maximum length (in bytes) for values created by `str()`, `buf()` and `path()`.
34493449

src/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Config::Config(bool has_cmd)
1919
{ ConfigKeyInt::max_cat_bytes, { .value = static_cast<uint64_t>(10240) } },
2020
{ ConfigKeyInt::max_map_keys, { .value = static_cast<uint64_t>(4096) } },
2121
{ ConfigKeyInt::max_probes, { .value = static_cast<uint64_t>(512) } },
22-
{ ConfigKeyInt::max_strlen, { .value = static_cast<uint64_t>(1024) } },
22+
{ ConfigKeyInt::max_strlen, { .value = static_cast<uint64_t>(64) } },
2323
{ ConfigKeyInt::max_type_res_iterations,
2424
{ .value = static_cast<uint64_t>(0) } },
2525
{ ConfigKeyInt::perf_rb_pages, { .value = static_cast<uint64_t>(64) } },

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void usage()
134134
std::cerr << " BPFTRACE_MAX_CAT_BYTES [default: 10k] maximum bytes read by cat builtin" << std::endl;
135135
std::cerr << " BPFTRACE_MAX_MAP_KEYS [default: 4096] max keys in a map" << std::endl;
136136
std::cerr << " BPFTRACE_MAX_PROBES [default: 512] max number of probes" << std::endl;
137-
std::cerr << " BPFTRACE_MAX_STRLEN [default: 1024] bytes on BPF stack per str()" << std::endl;
137+
std::cerr << " BPFTRACE_MAX_STRLEN [default: 64] bytes on BPF stack per str()" << std::endl;
138138
std::cerr << " BPFTRACE_MAX_TYPE_RES_ITERATIONS [default: 0] number of levels of nested field accesses for tracepoint args" << std::endl;
139139
std::cerr << " BPFTRACE_PERF_RB_PAGES [default: 64] pages per CPU to allocate for ring buffer" << std::endl;
140140
std::cerr << " BPFTRACE_STACK_MODE [default: bpftrace] Output format for ustack and kstack builtins" << std::endl;

tests/codegen/llvm/call_buf_implicit_size.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
117117
!47 = !DISubrange(count: 6, lowerBound: 0)
118118
!48 = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: !2, file: !2, baseType: !49, size: 64, offset: 192)
119119
!49 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !50, size: 64)
120-
!50 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 8192, elements: !51)
120+
!50 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 512, elements: !51)
121121
!51 = !{!52}
122-
!52 = !DISubrange(count: 1024, lowerBound: 0)
122+
!52 = !DISubrange(count: 64, lowerBound: 0)
123123
!53 = !DIGlobalVariableExpression(var: !54, expr: !DIExpression())
124124
!54 = distinct !DIGlobalVariable(name: "event_loss_counter", linkageName: "global", scope: !2, file: !2, type: !55, isLocal: false, isDefinition: true)
125125
!55 = !DICompositeType(tag: DW_TAG_structure_type, scope: !2, file: !2, size: 256, elements: !56)

tests/codegen/llvm/call_buf_size_literal.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
113113
!47 = !DISubrange(count: 6, lowerBound: 0)
114114
!48 = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: !2, file: !2, baseType: !49, size: 64, offset: 192)
115115
!49 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !50, size: 64)
116-
!50 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 8192, elements: !51)
116+
!50 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 512, elements: !51)
117117
!51 = !{!52}
118-
!52 = !DISubrange(count: 1024, lowerBound: 0)
118+
!52 = !DISubrange(count: 64, lowerBound: 0)
119119
!53 = !DIGlobalVariableExpression(var: !54, expr: !DIExpression())
120120
!54 = distinct !DIGlobalVariable(name: "event_loss_counter", linkageName: "global", scope: !2, file: !2, type: !55, isLocal: false, isDefinition: true)
121121
!55 = !DICompositeType(tag: DW_TAG_structure_type, scope: !2, file: !2, size: 256, elements: !56)

tests/codegen/llvm/call_buf_size_nonliteral.ll

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ target triple = "bpf-pc-linux"
77
%"struct map_t.0" = type { ptr, ptr }
88
%"struct map_t.1" = type { ptr, ptr, ptr, ptr }
99
%"struct map_t.2" = type { ptr, ptr, ptr, ptr }
10-
%buffer_1020_t = type <{ i32, [1020 x i8] }>
10+
%buffer_60_t = type <{ i32, [60 x i8] }>
1111

1212
@LICENSE = global [4 x i8] c"GPL\00", section "license"
1313
@AT_x = dso_local global %"struct map_t" zeroinitializer, section ".maps", !dbg !0
@@ -24,8 +24,8 @@ entry:
2424
%lookup_str_key = alloca i32, align 4
2525
%1 = getelementptr i64, ptr %0, i64 13
2626
%arg1 = load volatile i64, ptr %1, align 8
27-
%length.cmp = icmp ule i64 %arg1, 1020
28-
%length.select = select i1 %length.cmp, i64 %arg1, i64 1020
27+
%length.cmp = icmp ule i64 %arg1, 60
28+
%length.select = select i1 %length.cmp, i64 %arg1, i64 60
2929
call void @llvm.lifetime.start.p0(i64 -1, ptr %lookup_str_key)
3030
store i32 0, ptr %lookup_str_key, align 4
3131
%lookup_str_map = call ptr inttoptr (i64 1 to ptr)(ptr @str_buffer, ptr %lookup_str_key)
@@ -37,14 +37,14 @@ lookup_str_failure: ; preds = %entry
3737
ret i64 0
3838

3939
lookup_str_merge: ; preds = %entry
40-
%2 = getelementptr %buffer_1020_t, ptr %lookup_str_map, i32 0, i32 0
40+
%2 = getelementptr %buffer_60_t, ptr %lookup_str_map, i32 0, i32 0
4141
%3 = trunc i64 %length.select to i32
4242
store i32 %3, ptr %2, align 4
43-
%4 = getelementptr %buffer_1020_t, ptr %lookup_str_map, i32 0, i32 1
44-
%probe_read_kernel = call i64 inttoptr (i64 113 to ptr)(ptr %4, i32 1020, ptr null)
43+
%4 = getelementptr %buffer_60_t, ptr %lookup_str_map, i32 0, i32 1
44+
call void @llvm.memset.p0.i64(ptr align 1 %4, i8 0, i64 60, i1 false)
4545
%5 = getelementptr i64, ptr %0, i64 14
4646
%arg0 = load volatile i64, ptr %5, align 8
47-
%probe_read_kernel1 = call i64 inttoptr (i64 113 to ptr)(ptr %4, i32 %3, i64 %arg0)
47+
%probe_read_kernel = call i64 inttoptr (i64 113 to ptr)(ptr %4, i32 %3, i64 %arg0)
4848
call void @llvm.lifetime.start.p0(i64 -1, ptr %"@x_key")
4949
store i64 0, ptr %"@x_key", align 8
5050
%update_elem = call i64 inttoptr (i64 2 to ptr)(ptr @AT_x, ptr %"@x_key", ptr %lookup_str_map, i64 0)
@@ -58,8 +58,12 @@ declare void @llvm.lifetime.start.p0(i64 immarg %0, ptr nocapture %1) #1
5858
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
5959
declare void @llvm.lifetime.end.p0(i64 immarg %0, ptr nocapture %1) #1
6060

61+
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
62+
declare void @llvm.memset.p0.i64(ptr nocapture writeonly %0, i8 %1, i64 %2, i1 immarg %3) #2
63+
6164
attributes #0 = { nounwind }
6265
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
66+
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
6367

6468
!llvm.dbg.cu = !{!55}
6569
!llvm.module.flags = !{!57}
@@ -85,10 +89,10 @@ attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: re
8589
!18 = !DIBasicType(name: "int32", size: 32, encoding: DW_ATE_signed)
8690
!19 = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: !2, file: !2, baseType: !20, size: 64, offset: 192)
8791
!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 64)
88-
!21 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 8192, elements: !23)
92+
!21 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 512, elements: !23)
8993
!22 = !DIBasicType(name: "int8", size: 8, encoding: DW_ATE_signed)
9094
!23 = !{!24}
91-
!24 = !DISubrange(count: 1024, lowerBound: 0)
95+
!24 = !DISubrange(count: 64, lowerBound: 0)
9296
!25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression())
9397
!26 = distinct !DIGlobalVariable(name: "ringbuf", linkageName: "global", scope: !2, file: !2, type: !27, isLocal: false, isDefinition: true)
9498
!27 = !DICompositeType(tag: DW_TAG_structure_type, scope: !2, file: !2, size: 128, elements: !28)

tests/codegen/llvm/call_str.ll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ lookup_str_failure: ; preds = %entry
3232
ret i64 0
3333

3434
lookup_str_merge: ; preds = %entry
35-
%probe_read_kernel = call i64 inttoptr (i64 113 to ptr)(ptr %lookup_str_map, i32 1024, ptr null)
35+
call void @llvm.memset.p0.i64(ptr align 1 %lookup_str_map, i8 0, i64 64, i1 false)
3636
%1 = getelementptr i64, ptr %0, i64 14
3737
%arg0 = load volatile i64, ptr %1, align 8
38-
%probe_read_kernel_str = call i64 inttoptr (i64 115 to ptr)(ptr %lookup_str_map, i32 1024, i64 %arg0)
38+
%probe_read_kernel_str = call i64 inttoptr (i64 115 to ptr)(ptr %lookup_str_map, i32 64, i64 %arg0)
3939
call void @llvm.lifetime.start.p0(i64 -1, ptr %"@x_key")
4040
store i64 0, ptr %"@x_key", align 8
4141
%update_elem = call i64 inttoptr (i64 2 to ptr)(ptr @AT_x, ptr %"@x_key", ptr %lookup_str_map, i64 0)
@@ -49,8 +49,12 @@ declare void @llvm.lifetime.start.p0(i64 immarg %0, ptr nocapture %1) #1
4949
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
5050
declare void @llvm.lifetime.end.p0(i64 immarg %0, ptr nocapture %1) #1
5151

52+
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
53+
declare void @llvm.memset.p0.i64(ptr nocapture writeonly %0, i8 %1, i64 %2, i1 immarg %3) #2
54+
5255
attributes #0 = { nounwind }
5356
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
57+
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
5458

5559
!llvm.dbg.cu = !{!55}
5660
!llvm.module.flags = !{!57}
@@ -76,10 +80,10 @@ attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: re
7680
!18 = !DIBasicType(name: "int32", size: 32, encoding: DW_ATE_signed)
7781
!19 = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: !2, file: !2, baseType: !20, size: 64, offset: 192)
7882
!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 64)
79-
!21 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 8192, elements: !23)
83+
!21 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 512, elements: !23)
8084
!22 = !DIBasicType(name: "int8", size: 8, encoding: DW_ATE_signed)
8185
!23 = !{!24}
82-
!24 = !DISubrange(count: 1024, lowerBound: 0)
86+
!24 = !DISubrange(count: 64, lowerBound: 0)
8387
!25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression())
8488
!26 = distinct !DIGlobalVariable(name: "ringbuf", linkageName: "global", scope: !2, file: !2, type: !27, isLocal: false, isDefinition: true)
8589
!27 = !DICompositeType(tag: DW_TAG_structure_type, scope: !2, file: !2, size: 128, elements: !28)

tests/codegen/llvm/call_str_2_expr.ll

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ entry:
2424
%1 = getelementptr i64, ptr %0, i64 13
2525
%arg1 = load volatile i64, ptr %1, align 8
2626
%2 = add i64 %arg1, 1
27-
%str.min.cmp = icmp ule i64 %2, 1024
28-
%str.min.select = select i1 %str.min.cmp, i64 %2, i64 1024
27+
%str.min.cmp = icmp ule i64 %2, 64
28+
%str.min.select = select i1 %str.min.cmp, i64 %2, i64 64
2929
call void @llvm.lifetime.start.p0(i64 -1, ptr %lookup_str_key)
3030
store i32 0, ptr %lookup_str_key, align 4
3131
%lookup_str_map = call ptr inttoptr (i64 1 to ptr)(ptr @str_buffer, ptr %lookup_str_key)
@@ -37,7 +37,7 @@ lookup_str_failure: ; preds = %entry
3737
ret i64 0
3838

3939
lookup_str_merge: ; preds = %entry
40-
%probe_read_kernel = call i64 inttoptr (i64 113 to ptr)(ptr %lookup_str_map, i32 1024, ptr null)
40+
call void @llvm.memset.p0.i64(ptr align 1 %lookup_str_map, i8 0, i64 64, i1 false)
4141
%3 = getelementptr i64, ptr %0, i64 14
4242
%arg0 = load volatile i64, ptr %3, align 8
4343
%4 = trunc i64 %str.min.select to i32
@@ -55,8 +55,12 @@ declare void @llvm.lifetime.start.p0(i64 immarg %0, ptr nocapture %1) #1
5555
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
5656
declare void @llvm.lifetime.end.p0(i64 immarg %0, ptr nocapture %1) #1
5757

58+
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
59+
declare void @llvm.memset.p0.i64(ptr nocapture writeonly %0, i8 %1, i64 %2, i1 immarg %3) #2
60+
5861
attributes #0 = { nounwind }
5962
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
63+
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
6064

6165
!llvm.dbg.cu = !{!55}
6266
!llvm.module.flags = !{!57}
@@ -82,10 +86,10 @@ attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: re
8286
!18 = !DIBasicType(name: "int32", size: 32, encoding: DW_ATE_signed)
8387
!19 = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: !2, file: !2, baseType: !20, size: 64, offset: 192)
8488
!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 64)
85-
!21 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 8192, elements: !23)
89+
!21 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 512, elements: !23)
8690
!22 = !DIBasicType(name: "int8", size: 8, encoding: DW_ATE_signed)
8791
!23 = !{!24}
88-
!24 = !DISubrange(count: 1024, lowerBound: 0)
92+
!24 = !DISubrange(count: 64, lowerBound: 0)
8993
!25 = !DIGlobalVariableExpression(var: !26, expr: !DIExpression())
9094
!26 = distinct !DIGlobalVariable(name: "ringbuf", linkageName: "global", scope: !2, file: !2, type: !27, isLocal: false, isDefinition: true)
9195
!27 = !DICompositeType(tag: DW_TAG_structure_type, scope: !2, file: !2, size: 128, elements: !28)

tests/codegen/llvm/call_str_2_lit.ll

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ lookup_str_failure: ; preds = %entry
3232
ret i64 0
3333

3434
lookup_str_merge: ; preds = %entry
35-
%probe_read_kernel = call i64 inttoptr (i64 113 to ptr)(ptr %lookup_str_map, i32 1024, ptr null)
35+
call void @llvm.memset.p0.i64(ptr align 1 %lookup_str_map, i8 0, i64 64, i1 false)
3636
%1 = getelementptr i64, ptr %0, i64 14
3737
%arg0 = load volatile i64, ptr %1, align 8
3838
%probe_read_kernel_str = call i64 inttoptr (i64 115 to ptr)(ptr %lookup_str_map, i32 7, i64 %arg0)
@@ -49,8 +49,12 @@ declare void @llvm.lifetime.start.p0(i64 immarg %0, ptr nocapture %1) #1
4949
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
5050
declare void @llvm.lifetime.end.p0(i64 immarg %0, ptr nocapture %1) #1
5151

52+
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
53+
declare void @llvm.memset.p0.i64(ptr nocapture writeonly %0, i8 %1, i64 %2, i1 immarg %3) #2
54+
5255
attributes #0 = { nounwind }
5356
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
57+
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
5458

5559
!llvm.dbg.cu = !{!58}
5660
!llvm.module.flags = !{!60}
@@ -103,9 +107,9 @@ attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: re
103107
!45 = !DICompositeType(tag: DW_TAG_array_type, baseType: !8, size: 192, elements: !23)
104108
!46 = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: !2, file: !2, baseType: !47, size: 64, offset: 192)
105109
!47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !48, size: 64)
106-
!48 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 8192, elements: !49)
110+
!48 = !DICompositeType(tag: DW_TAG_array_type, baseType: !22, size: 512, elements: !49)
107111
!49 = !{!50}
108-
!50 = !DISubrange(count: 1024, lowerBound: 0)
112+
!50 = !DISubrange(count: 64, lowerBound: 0)
109113
!51 = !DIGlobalVariableExpression(var: !52, expr: !DIExpression())
110114
!52 = distinct !DIGlobalVariable(name: "event_loss_counter", linkageName: "global", scope: !2, file: !2, type: !53, isLocal: false, isDefinition: true)
111115
!53 = !DICompositeType(tag: DW_TAG_structure_type, scope: !2, file: !2, size: 256, elements: !54)

tests/codegen/llvm/optional_positional_parameter.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ lookup_str_failure: ; preds = %entry
4444
ret i64 0
4545

4646
lookup_str_merge: ; preds = %entry
47-
%probe_read_kernel = call i64 inttoptr (i64 113 to ptr)(ptr %lookup_str_map, i32 1024, ptr null)
47+
call void @llvm.memset.p0.i64(ptr align 1 %lookup_str_map, i8 0, i64 64, i1 false)
4848
call void @llvm.lifetime.start.p0(i64 -1, ptr %str)
4949
call void @llvm.memset.p0.i64(ptr align 1 %str, i8 0, i64 1, i1 false)
5050
store [1 x i8] zeroinitializer, ptr %str, align 1
5151
%1 = ptrtoint ptr %str to i64
52-
%probe_read_kernel_str = call i64 inttoptr (i64 115 to ptr)(ptr %lookup_str_map, i32 1024, i64 %1)
52+
%probe_read_kernel_str = call i64 inttoptr (i64 115 to ptr)(ptr %lookup_str_map, i32 64, i64 %1)
5353
call void @llvm.lifetime.end.p0(i64 -1, ptr %str)
5454
call void @llvm.lifetime.start.p0(i64 -1, ptr %"@y_key")
5555
store i64 0, ptr %"@y_key", align 8
@@ -102,10 +102,10 @@ attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
102102
!25 = !{!5, !11, !16, !26}
103103
!26 = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: !2, file: !2, baseType: !27, size: 64, offset: 192)
104104
!27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !28, size: 64)
105-
!28 = !DICompositeType(tag: DW_TAG_array_type, baseType: !29, size: 8192, elements: !30)
105+
!28 = !DICompositeType(tag: DW_TAG_array_type, baseType: !29, size: 512, elements: !30)
106106
!29 = !DIBasicType(name: "int8", size: 8, encoding: DW_ATE_signed)
107107
!30 = !{!31}
108-
!31 = !DISubrange(count: 1024, lowerBound: 0)
108+
!31 = !DISubrange(count: 64, lowerBound: 0)
109109
!32 = !DIGlobalVariableExpression(var: !33, expr: !DIExpression())
110110
!33 = distinct !DIGlobalVariable(name: "ringbuf", linkageName: "global", scope: !2, file: !2, type: !34, isLocal: false, isDefinition: true)
111111
!34 = !DICompositeType(tag: DW_TAG_structure_type, scope: !2, file: !2, size: 128, elements: !35)

tests/codegen/llvm/strncmp.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ lookup_str_failure: ; preds = %entry
4949
ret i64 0
5050

5151
lookup_str_merge: ; preds = %entry
52-
%probe_read_kernel = call i64 inttoptr (i64 113 to ptr)(ptr %lookup_str_map, i32 1024, ptr null)
52+
call void @llvm.memset.p0.i64(ptr align 1 %lookup_str_map, i8 0, i64 64, i1 false)
5353
%1 = ptrtoint ptr %0 to i64
5454
%2 = add i64 %1, 8
5555
%3 = inttoptr i64 %2 to ptr
5656
%4 = load volatile i64, ptr %3, align 8
57-
%probe_read_kernel_str = call i64 inttoptr (i64 115 to ptr)(ptr %lookup_str_map, i32 1024, i64 %4)
57+
%probe_read_kernel_str = call i64 inttoptr (i64 115 to ptr)(ptr %lookup_str_map, i32 64, i64 %4)
5858
call void @llvm.lifetime.start.p0(i64 -1, ptr %comm)
5959
call void @llvm.memset.p0.i64(ptr align 1 %comm, i8 0, i64 16, i1 false)
6060
%get_comm = call i64 inttoptr (i64 16 to ptr)(ptr %comm, i64 16)
@@ -329,10 +329,10 @@ attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
329329
!44 = !DISubrange(count: 6, lowerBound: 0)
330330
!45 = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: !2, file: !2, baseType: !46, size: 64, offset: 192)
331331
!46 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !47, size: 64)
332-
!47 = !DICompositeType(tag: DW_TAG_array_type, baseType: !48, size: 8192, elements: !49)
332+
!47 = !DICompositeType(tag: DW_TAG_array_type, baseType: !48, size: 512, elements: !49)
333333
!48 = !DIBasicType(name: "int8", size: 8, encoding: DW_ATE_signed)
334334
!49 = !{!50}
335-
!50 = !DISubrange(count: 1024, lowerBound: 0)
335+
!50 = !DISubrange(count: 64, lowerBound: 0)
336336
!51 = !DIGlobalVariableExpression(var: !52, expr: !DIExpression())
337337
!52 = distinct !DIGlobalVariable(name: "event_loss_counter", linkageName: "global", scope: !2, file: !2, type: !3, isLocal: false, isDefinition: true)
338338
!53 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "bpftrace", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, globals: !54)

0 commit comments

Comments
 (0)