Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open trace file with either firefox profiler or chrome #8

Closed
flodabo opened this issue Oct 19, 2021 · 2 comments
Closed

Cannot open trace file with either firefox profiler or chrome #8

flodabo opened this issue Oct 19, 2021 · 2 comments

Comments

@flodabo
Copy link

flodabo commented Oct 19, 2021

Actual Behavior

Chrome:

Cannot open file. Error Message:
image

Firefox Profiler

Cannot open file. Error Message:
image

Perfetto UI

Trace is shown correctly:
image

Expected Behavior

trace files can be open opened by all viewers that are mentioned in the readme, not just perfetto UI.

Versions

  • ansible: ansible 4.6.0 ansible-core 2.11.6
  • ansible-trace: main commit 8f92702
  • python: Python 3.9.2

simple playbook used for testing

---
- hosts: localhost
  gather_facts: true
  tasks:
    - name: "output if not debian 11"
      debug:
        msg: "test"
      when: 'not (ansible_distribution == "Debian" and ansible_distribution_major_version == "11")'

    - name: "output if debian 11"
      debug:
        msg: "test"
      when: (ansible_distribution == "Debian" and ansible_distribution_major_version == "11")

output of trace callback for test playbook

trace.json

[
{
  "args": {
    "name": "localhost"
  },
  "cat": "process",
  "name": "process_name",
  "ph": "M",
  "pid": 1
}[
{
  "args": {
    "args": null,
    "host": "localhost",
    "path": "/home/user/repos/ansible-test/testenv-test.yml:2",
    "task": "Gathering Facts"
  },
  "cat": "runner",
  "id": 6508616308570991776,
  "name": "Gathering Facts",
  "ph": "B",
  "pid": 1,
  "ts": 1634299695390039.8
}[
{
  "args": {
    "status": "ok"
  },
  "cat": "runner",
  "id": 6508616308570991776,
  "name": "Gathering Facts",
  "ph": "E",
  "pid": 1,
  "ts": 1634299696186142.0
}[
{
  "args": {
    "args": null,
    "host": "localhost",
    "path": "/home/user/repos/ansible-test/testenv-test.yml:5",
    "task": "output if not debian 11"
  },
  "cat": "runner",
  "id": 746051916975514963,
  "name": "output if not debian 11",
  "ph": "B",
  "pid": 1,
  "ts": 1634299696197881.8
}[
{
  "args": {
    "status": "skipped"
  },
  "cat": "runner",
  "id": 746051916975514963,
  "name": "output if not debian 11",
  "ph": "E",
  "pid": 1,
  "ts": 1634299696210522.0
}[
{
  "args": {
    "args": null,
    "host": "localhost",
    "path": "/home/user/repos/ansible-test/testenv-test.yml:10",
    "task": "output if debian 11"
  },
  "cat": "runner",
  "id": 1296121251497600435,
  "name": "output if debian 11",
  "ph": "B",
  "pid": 1,
  "ts": 1634299696215914.5
}[
{
  "args": {
    "status": "ok"
  },
  "cat": "runner",
  "id": 1296121251497600435,
  "name": "output if debian 11",
  "ph": "E",
  "pid": 1,
  "ts": 1634299696230237.2
}
]

modified trace file that i could open with perfettoUI, chrome and firefox profiler

[
{
  "args": {
    "name": "localhost"
  },
  "cat": "process",
  "name": "process_name",
  "ph": "M",
  "pid": 1
},
{
  "args": {
    "args": null,
    "host": "localhost",
    "path": "/home/user/repos/ansible-test/testenv-test.yml:2",
    "task": "Gathering Facts"
  },
  "cat": "runner",
  "id": 6508616308570991776,
  "name": "Gathering Facts",
  "ph": "B",
  "pid": 1,
  "ts": 1634299695390039.8
},
{
  "args": {
    "status": "ok"
  },
  "cat": "runner",
  "id": 6508616308570991776,
  "name": "Gathering Facts",
  "ph": "E",
  "pid": 1,
  "ts": 1634299696186142.0
},
{
  "args": {
    "args": null,
    "host": "localhost",
    "path": "/home/user/repos/ansible-test/testenv-test.yml:5",
    "task": "output if not debian 11"
  },
  "cat": "runner",
  "id": 746051916975514963,
  "name": "output if not debian 11",
  "ph": "B",
  "pid": 1,
  "ts": 1634299696197881.8
},
{
  "args": {
    "status": "skipped"
  },
  "cat": "runner",
  "id": 746051916975514963,
  "name": "output if not debian 11",
  "ph": "E",
  "pid": 1,
  "ts": 1634299696210522.0
},
{
  "args": {
    "args": null,
    "host": "localhost",
    "path": "/home/user/repos/ansible-test/testenv-test.yml:10",
    "task": "output if debian 11"
  },
  "cat": "runner",
  "id": 1296121251497600435,
  "name": "output if debian 11",
  "ph": "B",
  "pid": 1,
  "ts": 1634299696215914.5
},
{
  "args": {
    "status": "ok"
  },
  "cat": "runner",
  "id": 1296121251497600435,
  "name": "output if debian 11",
  "ph": "E",
  "pid": 1,
  "ts": 1634299696230237.2
}
]
@mhansen
Copy link
Owner

mhansen commented Oct 20, 2021

Thank you for this detailed report! Looks like I've fat-fingered something and added an extra [

@mhansen
Copy link
Owner

mhansen commented Oct 20, 2021

It's honestly amazing that Perfetto can open this at all given how badly I screwed up. Wow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants