Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Engine/ModuleInfoHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ await Task.Run(() => Parallel.ForEach(listOfCallStacks, currItem => {
// pass-through this line as it is either non-XML, 0-length or whitespace-only
outCallstack.AppendLine(line);
}
currItem.Callstack = outCallstack.ToString();
currItem.Callstack = outCallstack.ToString().Trim();
}
}));

Expand Down
4 changes: 2 additions & 2 deletions Engine/StackResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public async Task<string> ResolveCallstacksAsync(List<StackDetails> listOfCallSt

foreach (var currstack in listOfCallStacks) {
if (cts.IsCancellationRequested) { StatusMessage = OperationCanceled; PercentComplete = 0; return OperationCanceled; }
if (!string.IsNullOrEmpty(currstack.Resolvedstack)) finalCallstack.Append(currstack.Resolvedstack);
if (!string.IsNullOrEmpty(currstack.Resolvedstack)) finalCallstack.AppendLine(currstack.Resolvedstack);
else if (!string.IsNullOrEmpty(currstack.Callstack)) {
finalCallstack = new StringBuilder("WARNING: No output to show. This may indicate an internal error!");
break;
Expand Down Expand Up @@ -477,7 +477,7 @@ public async Task<List<StackDetails>> GetListofCallStacksAsync(string inputCalls
string callstackText = string.Empty;
if (reader.ReadToDescendant("value")) {
reader.Read();
if (XmlNodeType.Text == reader.NodeType || XmlNodeType.CDATA == reader.NodeType) callstackText = reader.Value;
if (XmlNodeType.Text == reader.NodeType || XmlNodeType.CDATA == reader.NodeType) callstackText = reader.Value.Trim();
}
if (string.IsNullOrEmpty(callstackText)) throw new XmlException();
allStacks.Add(new StackDetails(callstackText, framesOnSingleLine, annotation, $"Slot_{stacknum}\t[count:{slotcount}]:"));
Expand Down
2 changes: 2 additions & 0 deletions GUI/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,18 @@ private string PrepareLargeXEventInput() {
Assert.AreEqual(expected.Trim(), ret.Trim());
}

/// End-to-end test with XE histogram target and module+offset frames.
[TestMethod][TestCategory("Unit")]
public async Task E2EHistogramOffsets() {
using var csr = new StackResolver();
using var cts = new CancellationTokenSource();
var pdbPath = @"..\..\..\Tests\TestCases\TestOrdinal";
var input = "<HistogramTarget truncated=\"0\" buckets=\"256\">\r\n <Slot count=\"108633\">\r\n <value>sqldk.dll+40609\r\nsqldk.dll+40609</value>\r\n </Slot>\r\n<Slot count=\"108631\">\r\n <value>sqldk.dll+40609\r\nsqldk.dll+40609</value>\r\n </Slot>\r\n</HistogramTarget>";
var ret = await csr.ResolveCallstacksAsync(await csr.GetListofCallStacksAsync(input, true, cts), pdbPath, false, null, true, false, false, true, false, false, null, cts);
var expected = "Slot_0 [count:108633]:\r\n\r\nsqldk!MemoryClerkInternal::AllocatePagesWithFailureMode+644\r\nsqldk!MemoryClerkInternal::AllocatePagesWithFailureMode+644\r\n\r\nSlot_1\t[count:108631]:\r\n\r\nsqldk!MemoryClerkInternal::AllocatePagesWithFailureMode+644\r\nsqldk!MemoryClerkInternal::AllocatePagesWithFailureMode+644";
Assert.AreEqual(expected.Trim(), ret.Trim());
}

[TestMethod][TestCategory("Unit")] public async Task E2ESymSrvXMLFramesMultiHistogram() {
using var csr = new StackResolver();
using var cts = new CancellationTokenSource();
Expand Down Expand Up @@ -678,7 +690,7 @@ private string PrepareLargeXEventInput() {
"Annotation for histogram #2 <HistogramTarget truncated=\"0\" buckets=\"256\"><Slot count=\"5\"><value>0x00007FFEAC0F80CF 0x00007FFEAC1EE447 0x00007FFEAC1EE6F5</value></Slot></HistogramTarget>";

var ret = await csr.ResolveCallstacksAsync(await csr.GetListofCallStacksAsync(input, true, cts), pdbPath, false, null, false, false, false, true, false, false, null, cts);
var expected = "Annotation for histogram #1\r\nSlot_0 [count:5]:\r\n\r\nsqldk!XeSosPkg::spinlock_backoff::Publish+425\r\nsqldk!SpinlockBase::Sleep+182\r\nsqlmin!Spinlock<143,7,1>::SpinToAcquireWithExponentialBackoff+363\r\nsqlmin!lck_lockInternal+2042\r\nAnnotation for histogram #2\r\nSlot_1 [count:5]:\r\n\r\nsqlmin!lck_lockInternal+2042\r\nsqlmin!MDL::LockGenericLocal+382\r\nsqlmin!MDL::LockGenericIdsLocal+101";
var expected = "Annotation for histogram #1\r\nSlot_0 [count:5]:\r\n\r\nsqldk!XeSosPkg::spinlock_backoff::Publish+425\r\nsqldk!SpinlockBase::Sleep+182\r\nsqlmin!Spinlock<143,7,1>::SpinToAcquireWithExponentialBackoff+363\r\nsqlmin!lck_lockInternal+2042\r\n\r\nAnnotation for histogram #2\r\nSlot_1 [count:5]:\r\n\r\nsqlmin!lck_lockInternal+2042\r\nsqlmin!MDL::LockGenericLocal+382\r\nsqlmin!MDL::LockGenericIdsLocal+101";
Assert.AreEqual(expected.Trim(), ret.Trim());
}

Expand Down
2 changes: 1 addition & 1 deletion latestrelease.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-05-28 00:00
2025-06-06 00:00