Lines Matching +full:plugin +full:- +full:syntax +full:- +full:class +full:- +full:properties
5 ## Create a plugin
6 The guide below explains how to create a plugin for the Perfetto UI.
12 [Getting Started](./getting-started) guide for more detail.
17 ./tools/install-build-deps --ui
20 ### Copy the plugin skeleton argument
22 cp -r ui/src/plugins/com.example.Skeleton ui/src/plugins/<your-plugin-name>
24 Now edit `ui/src/plugins/<your-plugin-name>/index.ts`.
29 - Don't name the directory `XyzPlugin` just `Xyz`.
30 - The `pluginId` and directory name must match.
31 - Plugins should be prefixed with the reversed components of a domain
33 plugin should be named `com.example.Foo`.
34 - Core plugins maintained by the Perfetto team should use
36 - Commands should have ids with the pattern `example.com#DoSomething`
37 - Command's ids should be prefixed with the id of the plugin which
39 - Command names should have the form "Verb something something", and should be
41 - Good: "Pin janky frame timeline tracks"
42 - Bad: "Tracks are Displayed if Janky"
46 ./ui/run-dev-server
50 ### Enable your plugin argument
51 - Navigate to the plugins page: [localhost:10000/#!/plugins](http://localhost:10000/#!/plugins).
52 - Ctrl-F for your plugin name and enable it.
54 Later you can request for your plugin to be enabled by default.
55 Follow the [default plugins](#default-plugins) section for this.
57 ### Upload your plugin for review argument
58 - Update `ui/src/plugins/<your-plugin-name>/OWNERS` to include your email.
59 - Follow the [Contributing](./getting-started#contributing)
61 - Once uploaded add `stevegolton@google.com` as a reviewer for your CL.
63 ## Plugin extension points
72 Follow the [create a plugin](#create-a-plugin) to get an initial
73 skeleton for your plugin.
82 available all the time the plugin is active.
85 class MyPlugin implements Plugin {
90 name: 'Log "Hello, plugin!"',
91 callback: () => console.log('Hello, plugin!'),
109 The `id` should be prefixed with the plugin id followed by a `#`. All command
110 `id`s must be unique system-wide.
117 registered with the `PluginContext` are removed when the plugin is deactivated,
122 - [dev.perfetto.ExampleSimpleCommand](https://cs.android.com/android/platform/superproject/main/+/m…
123 - [dev.perfetto.CoreCommands](https://cs.android.com/android/platform/superproject/main/+/main:exte…
124 - [dev.perfetto.ExampleState](https://cs.android.com/android/platform/superproject/main/+/main:exte…
140 …emplate literal types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html).
143 for more details on how the hotkey syntax works, and for the available keys and
160 very common pattern), extend the `NamedSliceTrack` abstract base class and
164 - `id: INTEGER`: A unique ID for the slice.
165 - `ts: INTEGER`: The timestamp of the start of the slice.
166 - `dur: INTEGER`: The duration of the slice.
167 - `depth: INTEGER`: Integer value defining how deep the slice should be drawn in
170 - `name: TEXT`: Text to be rendered on the slice and in the popup.
175 class MyTrack extends NamedSliceTrack {
196 class MyPlugin implements Plugin {
215 Thus it only makes sense to add default tracks in your plugin's `onTraceLoad`
219 class MyPlugin implements Plugin {
239 class MyPlugin implements Plugin {
259 class MyPlugin implements Plugin {
284 To register a tab from a plugin, use the `PluginContextTrace.registerTab`
289 import {Tab, Plugin, PluginContext, PluginContextTrace} from '../../public';
291 class MyTab implements Tab {
301 class MyPlugin implements Plugin {
312 You'll need to pass in a tab-like object, something that implements the `Tab`
316 Registered tabs don't appear immediately - we need to show it first. All
330 Tabs have the following properties:
331 - Each tab has a unique URI.
332 - Only once instance of the tab may be open at a time. Calling showTab multiple
339 following additional properties:
340 - They appear in the tab dropdown.
341 - They remain once closed. The plugin controls the lifetime of the tab object.
343 Ephemeral tabs, by contrast, have the following properties:
344 - They do not appear in the tab dropdown.
345 - When they are hidden, they will be automatically unregistered.
367 Plugin,
374 class MyNameTab implements Tab {
384 class MyPlugin implements Plugin {
411 export const plugin: PluginDescriptor = {
413 plugin: MyPlugin,
419 permanently in the left-most tab position in the tab bar. Its purpose is to
428 class MyPlugin implements Plugin {
461 - [dev.perfetto.AndroidBinderViz](https://cs.android.com/android/platform/superproject/main/+/main:…
467 to gracefully handle permalinking and is an opt-in - not automatic -
470 Persistent plugin state works using a `Store<T>` where `T` is some JSON
505 First define an interface for your specific plugin state.
515 class MyPlugin implements Plugin {
527 - Loading a new trace
528 - Loading from a permalink
546 plugin store at the time the permalink was generated. This may be from an older
547 or newer version of the plugin.
571 // Null, undefined, or bad version number - return default value.
578 Migration should be unit-tested to ensure compatibility.
581 - [dev.perfetto.ExampleState](https://cs.android.com/android/platform/superproject/main/+/main:exte…
583 ## Guide to the plugin API
584 The plugin interfaces are defined in [ui/src/public/index.ts](https://cs.android.com/android/platfo…
588 These plugins are held to a higher quality than non-default plugins since changes to those plugins …
592 - Plugins must be licensed under
593 [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html)
595 - Plugins are the responsibility of the OWNERS of that plugin to
597 efforts will be made to keep the plugin API stable and existing