puppeteer: thread-instruction-count: tidelta / ticount don't exist in tracing file

Environment 1 puppeteer-core: 2.0.0 docker image: node:12-slim os version: macOS 10.14.6 node.js version: 12 chrome version: 77/78

Environment 2 puppeteer-core: 2.0.0 virtualisation: virtualbox 6 os version: Ubuntu 18.04 node.js version: 12 chrome version: 77

What steps will reproduce the problem? According to this message. Puppeteer provides RTI data in trace file when flags: --enable-thread-instruction-count and --no-sandbox are used. Information should be placed in tidelta and ticount properties.

Case:

const puppeteer = require('puppeteer')

;(async () => {
  const browser = await puppeteer.launch({
    args: ['--no-sandbox', '--enable-thread-instruction-count'],
  })
  const page = await browser.newPage()

  await page.tracing.start({ path: './trace.json' })
  await page.goto('https://www.example.com/')
  await page.tracing.stop()

  await browser.close()
})()

Dockerfile Chrome-Detect&Downloader

What is the expected result? tidelta exist in trace.json and parameter not empty.

What happens instead? tidelta doesn’t exist in trace.json.

What a goal to use this feature? I want to use RTI data for Web Perf Testing in tools like size-limit, estimo, etc.

PS I tried this case with docker image node:10-slim, chrome 77 and chrome 78. But tidelta always didn’t exist in trace file.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 42

Most upvoted comments

I just noticed that I was comparing two different chrome versions:


  "os-version": "5.5.13-arch2-1",
  "product-version": "HeadlessChrome/80.0.3987.163",
  "v8-version": "8.0.426.30"

  "os-version": "5.5.13-arch2-1",
  "product-version": "HeadlessChrome/84.0.4147.13",
  "v8-version": "8.4.371.7"

Will update chrome and test again

For anyone else curious – it appears that support for these fields was removed in Chrome in this Jun 2022 commit, which landed in release 105.0.5137.0:

https://chromium.googlesource.com/chromium/src/+/736be85b0d7c4fbfaacc7fcd8571828f8ad4dee1

When I manually launch chrome and enable tracing, I see in output

$ ./chrome --no-sandbox --enable-thread-instruction-count
[329820:329820:0609/065603.823454:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[329820:329820:0609/065605.305150:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
tracing_service_impl.cc: Configured tracing, #sources:2, duration:0 ms, #buffers:1, total buffer size:102400 KB, total sessions:1
[329975:329977:0609/065638.525405:ERROR:thread_instruction_count.cc(65)] perf_event_open failed, omitting instruction counters
[329975:329975:0609/065638.524778:ERROR:thread_instruction_count.cc(65)] perf_event_open failed, omitting instruction counters
[329822:329856:0609/065638.528999:ERROR:thread_instruction_count.cc(65)] perf_event_open failed, omitting instruction counters
[329975:329978:0609/065638.528997:ERROR:thread_instruction_count.cc(65)] perf_event_open failed, omitting instruction counters
[329822:329853:0609/065638.529197:ERROR:thread_instruction_count.cc(65)] perf_event_open failed, omitting instruction counters
[329820:329847:0609/065638.535137:ERROR:thread_instruction_count.cc(65)] perf_event_open failed, omitting instruction counters
[329894:329894:0609/065638.535123:ERROR:thread_instruction_count.cc(65)] perf_event_open failed, omitting instruction counters

Seems perf_event_open failed is source of problem?

And magic command “allow kernel profiling for non-privileged users”, that I find here - seems help:

echo 1 | sudo tee /proc/sys/kernel/perf_event_paranoid

After enabling it - I see ticount in json results of your test file!

Done using HeadlessChrome/83.0.4103.0 on native Ubuntu 20.04 Linux without docker: https://gist.github.com/MurzNN/5e2683d1c4e2e59d8478b4cc95c4366e

estimo on  rti [!] 
➜ yarn test:launch
yarn run v1.21.1
$ ESTIMO_DEBUG=true node ./test/__mock__/test-launch.js
/home/ai/estimo/test/__mock__

[estimo]: Found next js files: /home/ai/estimo/test/__mock__/19kb.js


[estimo]: Found next web pages: 


[js-mode]: ------------------------------------------
[js-mode]: Preparing file: /home/ai/estimo/test/__mock__/19kb.js

[estimo]: The file has been written: /home/ai/estimo/temp/sPzYoRgL34w3exHEdtDio.html

[js-mode]: Creating html content for js file: /home/ai/estimo/test/__mock__/19kb.js
[js-mode]: Js file name: 19kb.js
[js-mode]: Html file: /home/ai/estimo/temp/sPzYoRgL34w3exHEdtDio.html
[js-mode]: Url to html file: file:///home/ai/estimo/temp/sPzYoRgL34w3exHEdtDio.html
[js-mode]: Html content: 
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Estimo Template</title>
  </head>
  <body>
    <script src="/home/ai/estimo/test/__mock__/19kb.js"></script>
    <h1>Estimo</h1>
  </body>
</html>
[js-mode]: ------------------------------------------


DevTools listening on ws://127.0.0.1:34275/devtools/browser/3867a6ed-b816-4b38-96e8-821a50e98505
tracing_service_impl.cc: Configured tracing, #sources:2, duration:0 ms, #buffers:1, total buffer size:102400 KB, total sessions:1
tracing_service_impl.cc: Tracing session 1 ended, total sessions:0

[js-mode]: Next javascript resources has been prepared: [{"name":"19kb.js","url":"file:///home/ai/estimo/temp/sPzYoRgL34w3exHEdtDio.html","html":"/home/ai/estimo/temp/sPzYoRgL34w3exHEdtDio.html","trace":"/home/ai/estimo/temp/ZcNLFX8-IUKh1r_fnbkAd.json"}]


[report]: Processing resource: {"name":"19kb.js","url":"file:///home/ai/estimo/temp/sPzYoRgL34w3exHEdtDio.html","html":"/home/ai/estimo/temp/sPzYoRgL34w3exHEdtDio.html","trace":"/home/ai/estimo/temp/ZcNLFX8-IUKh1r_fnbkAd.json"}


[js-mode]: Got reports for js files: [{"name":"19kb.js","parseHTML":1.36,"styleLayout":4.55,"paintCompositeRender":0.47,"scriptParseCompile":2.14,"scriptEvaluation":9.82,"javaScript":11.96,"garbageCollection":0,"other":6.63,"total":24.97}]


[estimo]: Result reports: [{"name":"19kb.js","parseHTML":1.36,"styleLayout":4.55,"paintCompositeRender":0.47,"scriptParseCompile":2.14,"scriptEvaluation":9.82,"javaScript":11.96,"garbageCollection":0,"other":6.63,"total":24.97}]

[
  {
    name: '19kb.js',
    parseHTML: 1.36,
    styleLayout: 4.55,
    paintCompositeRender: 0.47,
    scriptParseCompile: 2.14,
    scriptEvaluation: 9.82,
    javaScript: 11.96,
    garbageCollection: 0,
    other: 6.63,
    total: 24.97
  }
]
Done in 0.54s

JSON: https://gist.github.com/ai/a5d31776e407ac701efd5c7670e0eeda

Fedora 31

@mbalabash

@mbalabash, I do test on Ubuntu 20.04, output is here: https://gist.github.com/MurzNN/52c8944c747d026d8afee509537c7a75 - ticount is missing 😦 Same results is with Chromium 78 (r686622) - I change them in cripts/chromeDetection.js.

@MurzNN Yes, you right. Your trace file don’t contain ticount and tidelta values. It means that something has been changed in the latest Chrome versions.

I not familiar with changes which were happened in 81, 82, 83 versions. So, I’m going to do homework and will provide an update ASAP.

Hello everyone! I want to ask your help guys.

If you are using Linux distro without any virtualization, you can help with testing this issue. (Currently, I can’t do it by myself, unfortunately)

What you can do:

  1. git clone -b rti https://github.com/mbalabash/estimo

  2. yarn install (It might take a while)

  3. yarn test:launch

  4. Copy+Paste console output from the latest command and include it in your comment

  5. Copy content from json file in path/to/estimo/temp/some-generic-id.json

    5.1. Create gist and paste content from previous step

    5.2. Provide link to this gist in your comment

  6. Provide your Linux distro name and version

  7. Post your comment and @ tag me there

Thanks to everyone who will help.

One gets the impression that this API can only work from under bare Linux, and any virtualization breaks it.

Can you help me to find out about this problem?