aboutsummaryrefslogtreecommitdiffstats
path: root/prog/parse.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-08-22 12:38:06 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-08-22 14:08:54 +0000
commit5e416b9760dc506494f60935ba8badf492728bff (patch)
tree46e111c9d774b66e77828dbf986622cabfa503e1 /prog/parse.go
parent6e3696e1821a99ba709c464e5e4a2fc455730b2b (diff)
prog: extract program IDs from the logs
Diffstat (limited to 'prog/parse.go')
-rw-r--r--prog/parse.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/prog/parse.go b/prog/parse.go
index c9c1564dc..bad2dcecc 100644
--- a/prog/parse.go
+++ b/prog/parse.go
@@ -12,13 +12,16 @@ import (
type LogEntry struct {
P *Prog
Proc int // index of parallel proc
+ ID int // ID of the executed program (-1 if not present)
Start int // start offset in log
End int // end offset in log
}
func (target *Target) ParseLog(data []byte) []*LogEntry {
var entries []*LogEntry
- ent := &LogEntry{}
+ ent := &LogEntry{
+ ID: -1,
+ }
var cur []byte
faultCall, faultNth := -1, -1
for pos := 0; pos < len(data); {
@@ -41,6 +44,10 @@ func (target *Target) ParseLog(data []byte) []*LogEntry {
ent = &LogEntry{
Proc: proc,
Start: pos0,
+ ID: -1,
+ }
+ if id, ok := extractInt(line, "id="); ok {
+ ent.ID = id
}
// We no longer print it this way, but we still parse such fragments to preserve
// the backward compatibility.