Open Bug 691309 Opened 13 years ago Updated 2 years ago

Monitor all main thread IO

Categories

(Core :: General, defect)

defect

Tracking

()

People

(Reporter: Yoric, Unassigned)

Details

(Keywords: main-thread-io, perf, Whiteboard: [mobilestartupshrink])

Attachments

(1 file)

We are not the only ones hunting down I/O in the main thread. Android offers a developer tool to monitor I/O happening in the main thread and, essentially, kill off applications that have any: http://www.talkandroid.com/23545-strict-mode-in-android-2-3-gingerbread-helps-developers-make-better-leaner-apps/ I do not think we have anything quite equivalent for Mozilla, although perhaps Instruments or XPerf can do something related. I am wondering if we could add a build mode that provides the same kind of feature.
Component: File Handling → General
QA Contact: file-handling → general
Attaching a small utility patch that makes any PRLog launched from the main thread easier to filter out.
With the profiler, we now have ways to do this by instrumenting low-level functions performing main thread IO. So this bug is now about instrumenting all low-level IO functions with SAMPLE_LABEL("IO", "FunctionName"). This will let us find all main thread IO by just filtering upon "IO::" in Cleopatra. More info about SAMPLE_LABEL: https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler#Pseudostack And a few examples: http://dxr.mozilla.org/search.cgi?tree=mozilla-central&string=SAMPLE_LABEL
Summary: startup perf- Investigate "IO strict mode" main thread → Monitor all main thread IO
Whiteboard: mobilestartupshrink → [mentor=Yoric][lang=c++][mobilestartupshrink]
We can start by labelling as IO: - the relevant methods of nsLocalFileUnix, nsLocalFileWin; - the relevant functions of sqlite. Or we can try and locate all Posix and Win32 IO functions.
I'll start working on this bug. Feel free to assign to me.
Actually, BenWa has advanced a lot on the more general question of monitoring I/O since the bug was filed. BenWa, can Richard help you at this stage?
Flags: needinfo?(bgirard)
We talked about this during the snappy work week: - Profile can highlight IO functions. This will find slow IO calls but the probability of it being missed decreases as the runtime for the IO is less then the sampling interval. - We plan on intercepting certain Gecko IO calls that will cover most IO calls in practice. We will instrument the code to repo this to the profiler and telemetry. Nathan what are the calls we are interested in watching?
Flags: needinfo?(bgirard) → needinfo?(nfroyd)
(In reply to Benoit Girard (:BenWa) from comment #6) > Nathan what are the calls we are interested in watching? We were planning on watching: - Wrapper functions in storage/src/TelemetryVFS.cpp; - Calls made by OS.File; - Calls made by NSPR (PR_Read/PR_Write/etc.). Those three categories might not catch everything, but they ought to catch the majority of interesting cases.
Flags: needinfo?(nfroyd)
Fwiw, barring any bug, OS.File should not be able to do main thread I/O, so they might not need watching – at least on the main thread.
Richard, if you are still interested in this bug, you should synchronize with BenWa and froydnj over irc.
Flags: needinfo?(richard)
Whiteboard: [mentor=Yoric][lang=c++][mobilestartupshrink] → [mobilestartupshrink]
Unfortunately i won't be able to look at this anymore.
Flags: needinfo?(richard)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: