From a065e04d529da1d847b5062a12c46d916408bf32 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 21:46:22 -0500 Subject: update based on https://github.com/mdn/yari/issues/2028 --- .../perfmeasurement.jsm/index.html | 302 --------------------- 1 file changed, 302 deletions(-) delete mode 100644 files/ja/mozilla/javascript_code_modules/perfmeasurement.jsm/index.html (limited to 'files/ja/mozilla/javascript_code_modules/perfmeasurement.jsm/index.html') diff --git a/files/ja/mozilla/javascript_code_modules/perfmeasurement.jsm/index.html b/files/ja/mozilla/javascript_code_modules/perfmeasurement.jsm/index.html deleted file mode 100644 index 175d7ad24c..0000000000 --- a/files/ja/mozilla/javascript_code_modules/perfmeasurement.jsm/index.html +++ /dev/null @@ -1,302 +0,0 @@ ---- -title: PerfMeasurement.jsm -slug: Mozilla/JavaScript_code_modules/PerfMeasurement.jsm -translation_of: Mozilla/JavaScript_code_modules/PerfMeasurement.jsm ---- -

{{ gecko_minversion_header("2.0") }}

- -

PerfMeasurement.jsm JavaScript コードモジュールを使用すると、コードの詳細なパフォーマンス測定値を取得できます。

- -

{{ note("The PerfMeasurement.jsm JavaScript code module can only be used from chrome -- that is, from within the application itself or an add-on.") }}

- -

Before you can use this module, you need to import it into your scope:

- -
Components.utils.import("resource://gre/modules/PerfMeasurement.jsm")
- -

See Measuring performance using the PerfMeasurement.jsm code module for details on how to use this API.

- -
Note: At present, PerfMeasurement.jsm is only functional on Linux, but it is planned to add support for Windows ({{ Bug(583322) }}) and OSX ({{ Bug(583323) }}) as well, and we welcome patches for other operating systems.
- -

Method overview

- - - - - - - - - - - - - - - - -
static bool canMeasureSomething();
void reset();
void start();
void stop();
- -

Member fields

- -

Recorded data variables

- -

These variables provide access to the recorded data. Any measurable event that was not being recorded has a value of -1 (that is, 0xFFFFFFFFFFFFFFFF).

- -
Note: These values are all zeroed (or set to -1, for events not being measured) when you initialize the PerfMeasurement object, then they are not zeroed again unless you explicitly call the {{ manch("reset") }} method. This lets you accumulate measurements over multiple passes through code that you want to analyze.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VariableTypeDescription
cpu_cyclesuint64The number of CPU cycles elapsed.
instructionsuint64The number of instructions executed.
cache_referencesuint64The number of memory accesses that occurred.
cache_missesuint64The number of times memory accesses missed the cache.
branch_instructionsuint64The number of branch instructions executed.
branch_missesuint64The number of times branch prediction guessed wrong.
bus_cyclesuint64The number of memory bus cycles that elapsed.
page_faultsuint64The number of page exceptions the OS handled.
major_page_faultsuint64The number of times page faults required disk access.
context_switchesuint64The number of context switches that occurred involving the thread being profiled.
cpu_migrationsuint64The number of times the profiled thread migrated from one CPU core to another.
- -

Event types measured constant

- -

The eventsMeasured constant provides a mask indicating which event types were recorded.

- - - - - - - - - - - - - - -
VariableTypeDescription
eventsMeasuredEventMaskA bit mask of the event types recorded; this can differ from the events requested if the platform doesn't support all of the event types you specified when creating the PerfMeasurement object.
- -

Constants

- -

Event mask constants

- -

These constants are used to construct the mask indicating which events you want to monitor.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstantValueDescription
CPU_CYCLES0x00000001Measure CPU cycles elapsed.
INSTRUCTIONS0x00000002Measure the number of instructions executed.
CACHE_REFERENCES0x00000004Measure the number of cache references.
CACHE_MISSES0x00000008Measure the number of cache misses.
BRANCH_INSTRUCTIONS0x00000010Measure the number of branch instructions executed.
BRANCH_MISSES0x00000020Measure the number of times branch prediction guesses wrong.
BUS_CYCLES0x00000040Measure the number of bus cycles elapsed.
PAGE_FAULTS0x00000080Measure the number of page faults that occurred.
MAJOR_PAGE_FAULTS0x00000100Measure the number of major page faults that occurred.
CONTEXT_SWITCHES0x00000200Measure the number of context switches that occurred.
CPU_MIGRATIONS0x00000400Measure the number of context switches that occurred.
ALL0x000007FFMeasure all available events.
- -

Number of available event types

- -

The NUM_MEASURABLE_EVENTS constant tells you how many types of events can be measured.

- - - - - - - - - - - - - - -
ConstantValueDescription
NUM_MEASURABLE_EVENTS11The number of types of events that can be measured.
- -

Constructor

- -

Creates a new PerfMeasurement object, configured to record the specified event types.

- -
PerfMeasurement(
-  EventMask toMeasure
-);
-
- -
Parameters
- -
-
toMeasure
-
A mask of all of the event types you want to record; see Event mask constants for a list of values. OR together all the event types you want to record, and pass that value here. Pass PerfMeasurement.ALL to record all event types.
-
- -
Return value
- -

A new PerfMeasurement object configured to record the specified event types.

- -

Methods

- -

canMeasureSomething()

- -

Indicates whether or not the platform on which your code is running supports this code module.

- -
static bool canMeasureSomething();
-
- -
Parameters
- -

None.

- -
Return value
- -

If even one of the event types can be recorded, this will return true. Otherwise, it returns false.

- -

reset()

- -

Resets all the enabled counters to zero.

- -
void reset();
-
- -
Parameters
- -

None.

- -

start()

- -

Starts measuring the performance indicators that were specified when the PerfMeasurement object was created.

- -
void start();
-
- -
Parameters
- -

None.

- -

stop()

- -

Stops measuring performance data. For each enabled counter, the number of measured events of that type that occurred are added to the appropriate visible variable.

- -
void stop();
-
- -
Parameters
- -

None.

- -

See also

- - -- cgit v1.2.3-54-g00ecf