Skip to content

Commit

Permalink
EventList: Add xml and json output format
Browse files Browse the repository at this point in the history
It will print events and event statistics as xml/json file or on stdout.
  • Loading branch information
arekzaluski authored Apr 17, 2023
1 parent e61d798 commit 47c1f75
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 65 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*.so
*.dylib

# macOS
.DS_Store

# Generated Files
Local_Release
Documentation/html
Expand Down
15 changes: 8 additions & 7 deletions tools/eventlist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ Usage:
eventlist [-I <scvdFile>]... [-o <outputFile>] [-a <elf/axfFile>] [-b] <logFile>

Flags:
-a <fileName> elf/axf file name
-b --begin show statistic at beginning
-h --help show short help
-I <fileName> include SCVD file name
-o <fileName> output file name
-s --statistic show statistic only
-V --version show version info
-a <fileName> elf/axf file name
-b --begin show statistic at beginning
-f <txt/xml/json> output format, default: txt
-h --help show short help
-I <fileName> include SCVD file name
-o <fileName> output file name
-s --statistic show statistic only
-V --version show version info
```

## Building the tool locally
Expand Down
4 changes: 3 additions & 1 deletion tools/eventlist/cmd/eventlist/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@ func main() {
infoOpt(commFlag, "o", "", "<fileName>")
infoOpt(commFlag, "s", "statistic", "")
infoOpt(commFlag, "V", "version", "")
infoOpt(commFlag, "f", "format", "<formatType>")
usage = true
}
// parse command line
commFlag.Var(&paths, "I", "include SCVD file name")
outputFile := commFlag.String("o", "", "output file name")
elfFile := commFlag.String("a", "", "elf/axf file name")
formatType := commFlag.String("f", "", "format type: txt, json, xml")
var statBegin bool
commFlag.BoolVar(&statBegin, "b", false, "show statistic at beginning")
commFlag.BoolVar(&statBegin, "begin", false, "show statistic at beginning")
Expand Down Expand Up @@ -169,7 +171,7 @@ func main() {
return
}

if err := output.Print(outputFile, &eventFile[0], evdefs, typedefs, statBegin, showStatistic); err != nil {
if err := output.Print(outputFile, formatType, &eventFile[0], evdefs, typedefs, statBegin, showStatistic); err != nil {
fmt.Print(Progname + ": ")
fmt.Println(err)
}
Expand Down
Loading

0 comments on commit 47c1f75

Please sign in to comment.