Skip to content

Commit 2d25853

Browse files
authored
Use slices of pointers in pprofile (#11339)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description All these slices of values have a potential to store large amounts of data, and should therefore be slices of pointers. <!-- Issue number if applicable --> #### Link to tracking issue Fixes #11281 cc @mx-psi @bogdandrutu
1 parent f9d44de commit 2d25853

23 files changed

+574
-284
lines changed

.chloggen/pprofile-slice-ptrs.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: 'breaking'
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: pdata/pprofile
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Replace slices of values to slices of pointers for the `Mapping`, `Location`, `Line`, `Function`, `AttributeUnit`, `Link`, `Value`, `Sample` and `Labels` attributes.
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [11339]
14+
15+
# Optional: The change log or logs in which this entry should be included.
16+
# e.g. '[user]' or '[user, api]'
17+
# Include 'user' if the change is relevant to end users.
18+
# Include 'api' if there is a change to a library API.
19+
# Default: '[user]'
20+
change_logs: [api]

pdata/internal/cmd/pdatagen/internal/pprofile_package.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ var profile = &messageValueStruct{
230230
},
231231
}
232232

233-
var valueTypeSlice = &sliceOfValues{
233+
var valueTypeSlice = &sliceOfPtrs{
234234
structName: "ValueTypeSlice",
235235
element: valueType,
236236
}
@@ -261,7 +261,7 @@ var valueType = &messageValueStruct{
261261
},
262262
}
263263

264-
var sampleSlice = &sliceOfValues{
264+
var sampleSlice = &sliceOfPtrs{
265265
structName: "SampleSlice",
266266
element: sample,
267267
}
@@ -318,7 +318,7 @@ var sample = &messageValueStruct{
318318
},
319319
}
320320

321-
var labelSlice = &sliceOfValues{
321+
var labelSlice = &sliceOfPtrs{
322322
structName: "LabelSlice",
323323
element: label,
324324
}
@@ -355,7 +355,7 @@ var label = &messageValueStruct{
355355
},
356356
}
357357

358-
var mappingSlice = &sliceOfValues{
358+
var mappingSlice = &sliceOfPtrs{
359359
structName: "MappingSlice",
360360
element: mapping,
361361
}
@@ -441,7 +441,7 @@ var mapping = &messageValueStruct{
441441
},
442442
}
443443

444-
var locationSlice = &sliceOfValues{
444+
var locationSlice = &sliceOfPtrs{
445445
structName: "LocationSlice",
446446
element: location,
447447
}
@@ -492,7 +492,7 @@ var location = &messageValueStruct{
492492
},
493493
}
494494

495-
var lineSlice = &sliceOfValues{
495+
var lineSlice = &sliceOfPtrs{
496496
structName: "LineSlice",
497497
element: line,
498498
}
@@ -523,7 +523,7 @@ var line = &messageValueStruct{
523523
},
524524
}
525525

526-
var functionSlice = &sliceOfValues{
526+
var functionSlice = &sliceOfPtrs{
527527
structName: "FunctionSlice",
528528
element: function,
529529
}
@@ -567,7 +567,7 @@ var function = &messageValueStruct{
567567
},
568568
}
569569

570-
var attributeUnitSlice = &sliceOfValues{
570+
var attributeUnitSlice = &sliceOfPtrs{
571571
structName: "AttributeUnitSlice",
572572
element: attributeUnit,
573573
}
@@ -592,7 +592,7 @@ var attributeUnit = &messageValueStruct{
592592
},
593593
}
594594

595-
var linkSlice = &sliceOfValues{
595+
var linkSlice = &sliceOfPtrs{
596596
structName: "LinkSlice",
597597
element: link,
598598
}

pdata/internal/data/protogen/profiles/v1experimental/pprofextended.pb.go

+121-121
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdata/pprofile/generated_attributeunitslice.go

+25-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdata/pprofile/generated_attributeunitslice_test.go

+22-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdata/pprofile/generated_functionslice.go

+25-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdata/pprofile/generated_functionslice_test.go

+22-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)