File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -218,8 +218,12 @@ func equalValueType(st1, st2 *profilev1.ValueType) bool {
218
218
219
219
func RewriteStrings (p * profilev1.Profile , n []uint32 ) {
220
220
for _ , t := range p .SampleType {
221
- t .Unit = int64 (n [t .Unit ])
222
- t .Type = int64 (n [t .Type ])
221
+ if t .Unit != 0 {
222
+ t .Unit = int64 (n [t .Unit ])
223
+ }
224
+ if t .Type != 0 {
225
+ t .Type = int64 (n [t .Type ])
226
+ }
223
227
}
224
228
for _ , s := range p .Sample {
225
229
for _ , l := range s .Label {
@@ -238,8 +242,12 @@ func RewriteStrings(p *profilev1.Profile, n []uint32) {
238
242
}
239
243
p .DropFrames = int64 (n [p .DropFrames ])
240
244
p .KeepFrames = int64 (n [p .KeepFrames ])
241
- p .PeriodType .Type = int64 (n [p .PeriodType .Type ])
242
- p .PeriodType .Unit = int64 (n [p .PeriodType .Unit ])
245
+ if p .PeriodType .Type != 0 {
246
+ p .PeriodType .Type = int64 (n [p .PeriodType .Type ])
247
+ }
248
+ if p .PeriodType .Unit != 0 {
249
+ p .PeriodType .Unit = int64 (n [p .PeriodType .Unit ])
250
+ }
243
251
for i , x := range p .Comment {
244
252
p .Comment [i ] = int64 (n [x ])
245
253
}
You can’t perform that action at this time.
0 commit comments