Skip to content

Commit a09f043

Browse files
authored
Support/show UST Context Fields (#81)
* Support/show UST Context Fields such as vtid, vpid, pthread_id, etc in Generic Events - https://lttng.org/man/3/lttng-ust/v2.7/#section-context
1 parent 6b24a15 commit a09f043

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

LTTngDataExtensions/DataOutputTypes/LTTngGenericEvent.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,16 @@ public LTTngGenericEvent(LTTngEvent data, LTTngContext context)
105105
// approach. We could probably generate a type from each event descriptor, and convert to that type.
106106
//
107107

108-
this.FieldValues = new List<string>(payload.Fields.Count);
108+
this.FieldNames = new List<string>(payload.Fields.Count + data.StreamDefinedEventContext.Fields.Count);
109+
this.FieldValues = new List<string>(payload.Fields.Count + data.StreamDefinedEventContext.Fields.Count);
110+
foreach (var field in data.StreamDefinedEventContext.Fields)
111+
{
112+
this.FieldNames.Add(field.FieldName.ToString());
113+
this.FieldValues.Add(field.GetValueAsString());
114+
}
109115
foreach (var field in payload.Fields)
110116
{
117+
this.FieldNames.Add(field.FieldName.ToString());
111118
this.FieldValues.Add(field.GetValueAsString());
112119
}
113120
}
@@ -123,6 +130,6 @@ public LTTngGenericEvent(LTTngEvent data, LTTngContext context)
123130
public uint DiscardedEvents { get; }
124131

125132
public readonly List<string> FieldValues;
126-
public List<string> FieldNames => this.kind.FieldNames;
133+
public readonly List<string> FieldNames;
127134
}
128135
}

LTTngDataExtensions/LTTngDataExtensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
5-
<Version>1.2.2</Version>
5+
<Version>1.2.3</Version>
66
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
77
<Authors>Microsoft</Authors>
88
<Company>Microsoft Corp.</Company>

0 commit comments

Comments
 (0)