diff --git a/python/tools/check_imports.py b/python/tools/check_imports.py index 07b684327f..2cebc63071 100755 --- a/python/tools/check_imports.py +++ b/python/tools/check_imports.py @@ -50,6 +50,7 @@ '/frontend/*', '/core/*', '/common/*', + '/components/*', '/public/*', '/trace_processor/*', '/widgets/*', @@ -59,10 +60,7 @@ ), # /public (interfaces + lib) can depend only on a restricted surface. - ('/public/*', ['/base/*', '/trace_processor/*']), - - # /public/lib can also depend on the plublic interface and widgets. - ('/public/lib/*', ['/public/*', '/frontend/widgets/*', '/widgets/*']), + ('/public/*', ['/base/*', '/trace_processor/*', '/widgets/*']), # /plugins (and core_plugins) can depend only on a restricted surface. ( @@ -72,7 +70,19 @@ '/public/*', '/trace_processor/*', '/widgets/*', - '/frontend/widgets/*', + '/components/*' + ], + ), + + # /components can depend on the 'base' packages & public + ( + '/components/*', + [ + '/base/*', + '/trace_processor/*', + '/widgets/*', + '/public/*', + '/components/*', ], ), @@ -92,61 +102,27 @@ ('/protos/index', '/gen/protos'), # ------ Technical debt that needs cleaning up below this point ------ - - # TODO(primiano): this dependency for BaseSliceTrack & co needs to be moved - # to /public/lib or something similar. - ('/*plugins/*', '/frontend/*track'), - - # TODO(primiano): clean up generic_slice_details_tab. - ('/*plugins/*', '/frontend/generic_slice_details_tab'), - - # TODO(primiano): these dependencies require a discussion with stevegolton@. - # unclear if they should be moved to public/lib/* or be part of the - # {Base/Named/Slice}Track overhaul. - ('/*plugins/*', [ - '/frontend/slice_layout', - '/frontend/slice_args', - '/frontend/checkerboard', - '/common/track_helper', - '/common/track_data', - ]), - - # TODO(primiano): clean up dependencies on feature flags. - (['/public/lib/colorizer'], '/core/feature_flags'), + # TODO(stevegolton): Remove these once we extract core types out of + # components. + ( + '/components/*', + [ + '/core/trace_impl', + '/core/app_impl', + '/core/router', + '/core/flow_types', + '/core/fake_trace_impl', + '/core/raf_scheduler', + '/core/feature_flags', + '/frontend/css_constants', + ], + ), # TODO(primiano): Record page-related technical debt. ('/plugins/dev.perfetto.RecordTrace/*', '/frontend/globals'), ('/chrome_extension/chrome_tracing_controller', '/plugins/dev.perfetto.RecordTrace/*'), - # TODO(primiano): query-table tech debt. - ( - '/public/lib/query_table/query_table', - ['/frontend/*', '/core/app_impl', '/core/router'], - ), - - # TODO(primiano): tracks tech debt. - ('/public/lib/tracks/*', [ - '/frontend/base_counter_track', - '/frontend/slice_args', - '/frontend/tracks/custom_sql_table_slice_track', - '/frontend/tracks/generic_slice_details_tab', - ]), - - # TODO(stevegolton): It's too much effort to change all the callsites of - # Timestamp and Duration widgets in order to inject trace into them. - ('/public/lib/widgets/*', [ - '/core/app_impl', - ]), - - # TODO(primiano): controller-related tech debt. - ('/frontend/index', '/controller/*'), - ('/controller/*', ['/base/*', '/core/*', '/common/*']), - - # TODO(primiano): check this with stevegolton@. Unclear if widgets should - # be allowed to depend on trace_processor. - ('/widgets/vega_view', '/trace_processor/*'), - # Bigtrace deps. ('/bigtrace/*', ['/base/*', '/widgets/*', '/trace_processor/*']), diff --git a/ui/src/frontend/download_utils.ts b/ui/src/base/download_utils.ts similarity index 100% rename from ui/src/frontend/download_utils.ts rename to ui/src/base/download_utils.ts diff --git a/ui/src/frontend/checkerboard.ts b/ui/src/components/checkerboard.ts similarity index 100% rename from ui/src/frontend/checkerboard.ts rename to ui/src/components/checkerboard.ts diff --git a/ui/src/public/lib/colorizer.ts b/ui/src/components/colorizer.ts similarity index 96% rename from ui/src/public/lib/colorizer.ts rename to ui/src/components/colorizer.ts index 52ef5123a8..ed0ead6f60 100644 --- a/ui/src/public/lib/colorizer.ts +++ b/ui/src/components/colorizer.ts @@ -13,11 +13,11 @@ // limitations under the License. import {hsl} from 'color-convert'; -import {hash} from '../../base/hash'; -import {featureFlags} from '../../core/feature_flags'; -import {Color, HSLColor, HSLuvColor} from '../color'; -import {ColorScheme} from '../color_scheme'; -import {RandState, pseudoRand} from '../../base/rand'; +import {hash} from '../base/hash'; +import {featureFlags} from '../core/feature_flags'; +import {Color, HSLColor, HSLuvColor} from '../public/color'; +import {ColorScheme} from '../public/color_scheme'; +import {RandState, pseudoRand} from '../base/rand'; // 128 would provide equal weighting between dark and light text. // However, we want to prefer light text for stylistic reasons. diff --git a/ui/src/public/lib/colorizer_unittest.ts b/ui/src/components/colorizer_unittest.ts similarity index 100% rename from ui/src/public/lib/colorizer_unittest.ts rename to ui/src/components/colorizer_unittest.ts diff --git a/ui/src/common/add_ephemeral_tab.ts b/ui/src/components/details/add_ephemeral_tab.ts similarity index 89% rename from ui/src/common/add_ephemeral_tab.ts rename to ui/src/components/details/add_ephemeral_tab.ts index 9ef6aca60d..499487db31 100644 --- a/ui/src/common/add_ephemeral_tab.ts +++ b/ui/src/components/details/add_ephemeral_tab.ts @@ -11,9 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import {uuidv4} from '../base/uuid'; -import {AppImpl} from '../core/app_impl'; -import {Tab} from '../public/tab'; +import {uuidv4} from '../../base/uuid'; +import {AppImpl} from '../../core/app_impl'; +import {Tab} from '../../public/tab'; // TODO(primiano): this method should take a Trace parameter (or probably // shouldn't exist at all in favour of some helper in the Trace object). diff --git a/ui/src/frontend/process_details_tab.ts b/ui/src/components/details/process_details_tab.ts similarity index 85% rename from ui/src/frontend/process_details_tab.ts rename to ui/src/components/details/process_details_tab.ts index c45740814f..53a361ec7c 100644 --- a/ui/src/frontend/process_details_tab.ts +++ b/ui/src/components/details/process_details_tab.ts @@ -13,14 +13,14 @@ // limitations under the License. import m from 'mithril'; -import {Tab} from '../public/tab'; -import {Upid} from '../trace_processor/sql_utils/core_types'; -import {DetailsShell} from '../widgets/details_shell'; -import {GridLayout, GridLayoutColumn} from '../widgets/grid_layout'; -import {Section} from '../widgets/section'; -import {Details, DetailsSchema} from './widgets/sql/details/details'; +import {Tab} from '../../public/tab'; +import {Upid} from '../sql_utils/core_types'; +import {DetailsShell} from '../../widgets/details_shell'; +import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout'; +import {Section} from '../../widgets/section'; +import {Details, DetailsSchema} from '../widgets/sql/details/details'; import d = DetailsSchema; -import {Trace} from '../public/trace'; +import {Trace} from '../../public/trace'; export class ProcessDetailsTab implements Tab { private data: Details; diff --git a/ui/src/frontend/slice_args.ts b/ui/src/components/details/slice_args.ts similarity index 87% rename from ui/src/frontend/slice_args.ts rename to ui/src/components/details/slice_args.ts index 88ecc65a6c..d5cfe4608f 100644 --- a/ui/src/frontend/slice_args.ts +++ b/ui/src/components/details/slice_args.ts @@ -13,19 +13,19 @@ // limitations under the License. import m from 'mithril'; -import {isString} from '../base/object_utils'; -import {Icons} from '../base/semantic_icons'; -import {sqliteString} from '../base/string_utils'; -import {exists} from '../base/utils'; +import {isString} from '../../base/object_utils'; +import {Icons} from '../../base/semantic_icons'; +import {sqliteString} from '../../base/string_utils'; +import {exists} from '../../base/utils'; import {ArgNode, convertArgsToTree, Key} from './slice_args_parser'; -import {Anchor} from '../widgets/anchor'; -import {MenuItem, PopupMenu2} from '../widgets/menu'; -import {TreeNode} from '../widgets/tree'; -import {Arg} from '../trace_processor/sql_utils/args'; -import {assertExists} from '../base/logging'; -import {getSqlTableDescription} from './widgets/sql/table/sql_table_registry'; -import {Trace} from '../public/trace'; -import {extensions} from '../public/lib/extensions'; +import {Anchor} from '../../widgets/anchor'; +import {MenuItem, PopupMenu2} from '../../widgets/menu'; +import {TreeNode} from '../../widgets/tree'; +import {Arg} from '../sql_utils/args'; +import {assertExists} from '../../base/logging'; +import {getSqlTableDescription} from '../widgets/sql/table/sql_table_registry'; +import {Trace} from '../../public/trace'; +import {extensions} from '../extensions'; // Renders slice arguments (key/value pairs) as a subtree. export function renderArguments(trace: Trace, args: Arg[]): m.Children { diff --git a/ui/src/frontend/slice_args_parser.ts b/ui/src/components/details/slice_args_parser.ts similarity index 97% rename from ui/src/frontend/slice_args_parser.ts rename to ui/src/components/details/slice_args_parser.ts index 90dd45df23..dd4ef83f0a 100644 --- a/ui/src/frontend/slice_args_parser.ts +++ b/ui/src/components/details/slice_args_parser.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {isString} from '../base/object_utils'; -import {exists} from '../base/utils'; +import {isString} from '../../base/object_utils'; +import {exists} from '../../base/utils'; export type Key = string | number; diff --git a/ui/src/frontend/slice_args_parser_unittest.ts b/ui/src/components/details/slice_args_parser_unittest.ts similarity index 100% rename from ui/src/frontend/slice_args_parser_unittest.ts rename to ui/src/components/details/slice_args_parser_unittest.ts diff --git a/ui/src/public/lib/details/slice_details.ts b/ui/src/components/details/slice_details.ts similarity index 83% rename from ui/src/public/lib/details/slice_details.ts rename to ui/src/components/details/slice_details.ts index 446866077e..80c743a545 100644 --- a/ui/src/public/lib/details/slice_details.ts +++ b/ui/src/components/details/slice_details.ts @@ -13,26 +13,26 @@ // limitations under the License. import m from 'mithril'; -import {BigintMath} from '../../../base/bigint_math'; -import {sqliteString} from '../../../base/string_utils'; -import {exists} from '../../../base/utils'; -import {SliceDetails} from '../../../trace_processor/sql_utils/slice'; -import {Anchor} from '../../../widgets/anchor'; -import {MenuItem, PopupMenu2} from '../../../widgets/menu'; -import {Section} from '../../../widgets/section'; -import {SqlRef} from '../../../widgets/sql_ref'; -import {Tree, TreeNode} from '../../../widgets/tree'; +import {BigintMath} from '../../base/bigint_math'; +import {sqliteString} from '../../base/string_utils'; +import {exists} from '../../base/utils'; +import {SliceDetails} from '../sql_utils/slice'; +import {Anchor} from '../../widgets/anchor'; +import {MenuItem, PopupMenu2} from '../../widgets/menu'; +import {Section} from '../../widgets/section'; +import {SqlRef} from '../../widgets/sql_ref'; +import {Tree, TreeNode} from '../../widgets/tree'; import { BreakdownByThreadState, BreakdownByThreadStateTreeNode, } from './thread_state'; import {DurationWidget} from '../widgets/duration'; -import {renderProcessRef} from '../../../frontend/widgets/process'; -import {renderThreadRef} from '../../../frontend/widgets/thread'; +import {renderProcessRef} from '../widgets/process'; +import {renderThreadRef} from '../widgets/thread'; import {Timestamp} from '../widgets/timestamp'; -import {getSqlTableDescription} from '../../../frontend/widgets/sql/table/sql_table_registry'; -import {assertExists} from '../../../base/logging'; -import {Trace} from '../../trace'; +import {getSqlTableDescription} from '../widgets/sql/table/sql_table_registry'; +import {assertExists} from '../../base/logging'; +import {Trace} from '../../public/trace'; import {extensions} from '../extensions'; // Renders a widget storing all of the generic details for a slice from the diff --git a/ui/src/frontend/sql_table_tab.ts b/ui/src/components/details/sql_table_tab.ts similarity index 80% rename from ui/src/frontend/sql_table_tab.ts rename to ui/src/components/details/sql_table_tab.ts index b803148546..6663858777 100644 --- a/ui/src/frontend/sql_table_tab.ts +++ b/ui/src/components/details/sql_table_tab.ts @@ -13,27 +13,27 @@ // limitations under the License. import m from 'mithril'; -import {copyToClipboard} from '../base/clipboard'; -import {Icons} from '../base/semantic_icons'; -import {exists} from '../base/utils'; -import {Button} from '../widgets/button'; -import {DetailsShell} from '../widgets/details_shell'; -import {Popup, PopupPosition} from '../widgets/popup'; -import {AddDebugTrackMenu} from '../public/lib/tracks/add_debug_track_menu'; -import {Filter} from './widgets/sql/table/column'; -import {SqlTableState} from './widgets/sql/table/state'; -import {SqlTable} from './widgets/sql/table/table'; -import {SqlTableDescription} from './widgets/sql/table/table_description'; -import {Trace} from '../public/trace'; -import {MenuItem, PopupMenu2} from '../widgets/menu'; -import {addEphemeralTab} from '../common/add_ephemeral_tab'; -import {Tab} from '../public/tab'; -import {addChartTab} from './widgets/charts/chart_tab'; +import {copyToClipboard} from '../../base/clipboard'; +import {Icons} from '../../base/semantic_icons'; +import {exists} from '../../base/utils'; +import {Button} from '../../widgets/button'; +import {DetailsShell} from '../../widgets/details_shell'; +import {Popup, PopupPosition} from '../../widgets/popup'; +import {AddDebugTrackMenu} from '../tracks/add_debug_track_menu'; +import {Filter} from '../widgets/sql/table/column'; +import {SqlTableState} from '../widgets/sql/table/state'; +import {SqlTable} from '../widgets/sql/table/table'; +import {SqlTableDescription} from '../widgets/sql/table/table_description'; +import {Trace} from '../../public/trace'; +import {MenuItem, PopupMenu2} from '../../widgets/menu'; +import {addEphemeralTab} from './add_ephemeral_tab'; +import {Tab} from '../../public/tab'; +import {addChartTab} from '../widgets/charts/chart_tab'; import { ChartOption, createChartConfigFromSqlTableState, -} from './widgets/charts/chart'; -import {AddChartMenuItem} from './widgets/charts/add_chart_menu'; +} from '../widgets/charts/chart'; +import {AddChartMenuItem} from '../widgets/charts/add_chart_menu'; export interface AddSqlTableTabParams { table: SqlTableDescription; diff --git a/ui/src/frontend/thread_details_tab.ts b/ui/src/components/details/thread_details_tab.ts similarity index 82% rename from ui/src/frontend/thread_details_tab.ts rename to ui/src/components/details/thread_details_tab.ts index f790a6869b..4069db1782 100644 --- a/ui/src/frontend/thread_details_tab.ts +++ b/ui/src/components/details/thread_details_tab.ts @@ -13,14 +13,14 @@ // limitations under the License. import m from 'mithril'; -import {Tab} from '../public/tab'; -import {Utid} from '../trace_processor/sql_utils/core_types'; -import {DetailsShell} from '../widgets/details_shell'; -import {GridLayout, GridLayoutColumn} from '../widgets/grid_layout'; -import {Section} from '../widgets/section'; -import {Details, DetailsSchema} from './widgets/sql/details/details'; +import {Tab} from '../../public/tab'; +import {Utid} from '../sql_utils/core_types'; +import {DetailsShell} from '../../widgets/details_shell'; +import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout'; +import {Section} from '../../widgets/section'; +import {Details, DetailsSchema} from '../widgets/sql/details/details'; import d = DetailsSchema; -import {Trace} from '../public/trace'; +import {Trace} from '../../public/trace'; export class ThreadDetailsTab implements Tab { private data: Details; diff --git a/ui/src/frontend/thread_slice_details_tab.ts b/ui/src/components/details/thread_slice_details_tab.ts similarity index 89% rename from ui/src/frontend/thread_slice_details_tab.ts rename to ui/src/components/details/thread_slice_details_tab.ts index b872a6d116..fae2e089c7 100644 --- a/ui/src/frontend/thread_slice_details_tab.ts +++ b/ui/src/components/details/thread_slice_details_tab.ts @@ -13,35 +13,35 @@ // limitations under the License. import m from 'mithril'; -import {Icons} from '../base/semantic_icons'; -import {TimeSpan} from '../base/time'; -import {exists} from '../base/utils'; -import {Engine} from '../trace_processor/engine'; -import {Button} from '../widgets/button'; -import {DetailsShell} from '../widgets/details_shell'; -import {GridLayout, GridLayoutColumn} from '../widgets/grid_layout'; -import {MenuItem, PopupMenu2} from '../widgets/menu'; -import {Section} from '../widgets/section'; -import {Tree} from '../widgets/tree'; -import {Flow, FlowPoint} from '../core/flow_types'; +import {Icons} from '../../base/semantic_icons'; +import {TimeSpan} from '../../base/time'; +import {exists} from '../../base/utils'; +import {Engine} from '../../trace_processor/engine'; +import {Button} from '../../widgets/button'; +import {DetailsShell} from '../../widgets/details_shell'; +import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout'; +import {MenuItem, PopupMenu2} from '../../widgets/menu'; +import {Section} from '../../widgets/section'; +import {Tree} from '../../widgets/tree'; +import {Flow, FlowPoint} from '../../core/flow_types'; import {hasArgs, renderArguments} from './slice_args'; -import {renderDetails} from '../public/lib/details/slice_details'; -import {getSlice, SliceDetails} from '../trace_processor/sql_utils/slice'; +import {renderDetails} from './slice_details'; +import {getSlice, SliceDetails} from '../sql_utils/slice'; import { BreakdownByThreadState, breakDownIntervalByThreadState, -} from '../public/lib/details/thread_state'; -import {asSliceSqlId} from '../trace_processor/sql_utils/core_types'; -import {DurationWidget} from '../public/lib/widgets/duration'; -import {SliceRef} from './widgets/slice'; -import {BasicTable} from '../widgets/basic_table'; -import {getSqlTableDescription} from './widgets/sql/table/sql_table_registry'; -import {assertExists} from '../base/logging'; -import {Trace} from '../public/trace'; -import {TrackEventDetailsPanel} from '../public/details_panel'; -import {TrackEventSelection} from '../public/selection'; -import {extensions} from '../public/lib/extensions'; -import {TraceImpl} from '../core/trace_impl'; +} from './thread_state'; +import {asSliceSqlId} from '../sql_utils/core_types'; +import {DurationWidget} from '../widgets/duration'; +import {SliceRef} from '../widgets/slice'; +import {BasicTable} from '../../widgets/basic_table'; +import {getSqlTableDescription} from '../widgets/sql/table/sql_table_registry'; +import {assertExists} from '../../base/logging'; +import {Trace} from '../../public/trace'; +import {TrackEventDetailsPanel} from '../../public/details_panel'; +import {TrackEventSelection} from '../../public/selection'; +import {extensions} from '../extensions'; +import {TraceImpl} from '../../core/trace_impl'; interface ContextMenuItem { name: string; diff --git a/ui/src/public/lib/details/thread_state.ts b/ui/src/components/details/thread_state.ts similarity index 93% rename from ui/src/public/lib/details/thread_state.ts rename to ui/src/components/details/thread_state.ts index 6545db0321..451d5e114c 100644 --- a/ui/src/public/lib/details/thread_state.ts +++ b/ui/src/components/details/thread_state.ts @@ -13,17 +13,17 @@ // limitations under the License. import m from 'mithril'; -import {duration, TimeSpan} from '../../../base/time'; -import {Engine} from '../../../trace_processor/engine'; +import {duration, TimeSpan} from '../../base/time'; +import {Engine} from '../../trace_processor/engine'; import { LONG, NUM_NULL, STR, STR_NULL, -} from '../../../trace_processor/query_result'; -import {TreeNode} from '../../../widgets/tree'; -import {Utid} from '../../../trace_processor/sql_utils/core_types'; +} from '../../trace_processor/query_result'; +import {TreeNode} from '../../widgets/tree'; import {DurationWidget} from '../widgets/duration'; +import {Utid} from '../sql_utils/core_types'; // An individual node of the thread state breakdown tree. class Node { diff --git a/ui/src/public/lib/extensions.ts b/ui/src/components/extensions.ts similarity index 89% rename from ui/src/public/lib/extensions.ts rename to ui/src/components/extensions.ts index 00b9555d4d..c5858c0da0 100644 --- a/ui/src/public/lib/extensions.ts +++ b/ui/src/components/extensions.ts @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {type addDebugSliceTrack} from '../debug_tracks'; +import {type addDebugSliceTrack} from './tracks/debug_tracks'; import {type addDebugCounterTrack} from './tracks/debug_tracks'; -import {type addSqlTableTab} from '../../frontend/sql_table_tab'; -import {type addVisualizedArgTracks} from '../../frontend/visualized_args_tracks'; +import {type addSqlTableTab} from './details/sql_table_tab'; +import {type addVisualizedArgTracks} from './tracks/visualized_args_tracks'; import {type addQueryResultsTab} from './query_table/query_result_tab'; // TODO(primiano & stevegolton): This injection is to break the circular diff --git a/ui/src/public/lib/query_flamegraph.ts b/ui/src/components/query_flamegraph.ts similarity index 96% rename from ui/src/public/lib/query_flamegraph.ts rename to ui/src/components/query_flamegraph.ts index ae9474b3ad..c9b2a0e73b 100644 --- a/ui/src/public/lib/query_flamegraph.ts +++ b/ui/src/components/query_flamegraph.ts @@ -13,30 +13,30 @@ // limitations under the License. import m from 'mithril'; -import {AsyncLimiter} from '../../base/async_limiter'; -import {AsyncDisposableStack} from '../../base/disposable_stack'; -import {assertExists} from '../../base/logging'; -import {Monitor} from '../../base/monitor'; -import {uuidv4Sql} from '../../base/uuid'; -import {Engine} from '../../trace_processor/engine'; +import {AsyncLimiter} from '../base/async_limiter'; +import {AsyncDisposableStack} from '../base/disposable_stack'; +import {assertExists} from '../base/logging'; +import {Monitor} from '../base/monitor'; +import {uuidv4Sql} from '../base/uuid'; +import {Engine} from '../trace_processor/engine'; import { createPerfettoIndex, createPerfettoTable, -} from '../../trace_processor/sql_utils'; +} from '../trace_processor/sql_utils'; import { NUM, NUM_NULL, STR, STR_NULL, UNKNOWN, -} from '../../trace_processor/query_result'; +} from '../trace_processor/query_result'; import { Flamegraph, FlamegraphQueryData, FlamegraphState, FlamegraphView, -} from '../../widgets/flamegraph'; -import {Trace} from '../trace'; +} from '../widgets/flamegraph'; +import {Trace} from '../public/trace'; export interface QueryFlamegraphColumn { // The name of the column in SQL. diff --git a/ui/src/public/lib/query_table/queries.ts b/ui/src/components/query_table/queries.ts similarity index 96% rename from ui/src/public/lib/query_table/queries.ts rename to ui/src/components/query_table/queries.ts index 147989addc..2f9685fb7f 100644 --- a/ui/src/public/lib/query_table/queries.ts +++ b/ui/src/components/query_table/queries.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {Engine} from '../../../trace_processor/engine'; -import {Row} from '../../../trace_processor/query_result'; +import {Engine} from '../../trace_processor/engine'; +import {Row} from '../../trace_processor/query_result'; const MAX_DISPLAY_ROWS = 10000; diff --git a/ui/src/public/lib/query_table/query_result_tab.ts b/ui/src/components/query_table/query_result_tab.ts similarity index 92% rename from ui/src/public/lib/query_table/query_result_tab.ts rename to ui/src/components/query_table/query_result_tab.ts index bf30cd064a..dba01eebdd 100644 --- a/ui/src/public/lib/query_table/query_result_tab.ts +++ b/ui/src/components/query_table/query_result_tab.ts @@ -14,16 +14,16 @@ import m from 'mithril'; import {v4 as uuidv4} from 'uuid'; -import {assertExists} from '../../../base/logging'; +import {assertExists} from '../../base/logging'; import {QueryResponse, runQuery} from './queries'; -import {QueryError} from '../../../trace_processor/query_result'; +import {QueryError} from '../../trace_processor/query_result'; import {AddDebugTrackMenu} from '../tracks/add_debug_track_menu'; -import {Button} from '../../../widgets/button'; -import {PopupMenu2} from '../../../widgets/menu'; -import {PopupPosition} from '../../../widgets/popup'; +import {Button} from '../../widgets/button'; +import {PopupMenu2} from '../../widgets/menu'; +import {PopupPosition} from '../../widgets/popup'; import {QueryTable} from './query_table'; -import {Trace} from '../../../public/trace'; -import {Tab} from '../../tab'; +import {Trace} from '../../public/trace'; +import {Tab} from '../../public/tab'; interface QueryResultTabConfig { readonly query: string; diff --git a/ui/src/public/lib/query_table/query_table.ts b/ui/src/components/query_table/query_table.ts similarity index 92% rename from ui/src/public/lib/query_table/query_table.ts rename to ui/src/components/query_table/query_table.ts index 2ab39e17f6..d2ad94c649 100644 --- a/ui/src/public/lib/query_table/query_table.ts +++ b/ui/src/components/query_table/query_table.ts @@ -13,21 +13,21 @@ // limitations under the License. import m from 'mithril'; -import {BigintMath} from '../../../base/bigint_math'; -import {copyToClipboard} from '../../../base/clipboard'; -import {isString} from '../../../base/object_utils'; -import {Time} from '../../../base/time'; +import {BigintMath} from '../../base/bigint_math'; +import {copyToClipboard} from '../../base/clipboard'; +import {isString} from '../../base/object_utils'; +import {Time} from '../../base/time'; import {QueryResponse} from './queries'; -import {Row} from '../../../trace_processor/query_result'; -import {Anchor} from '../../../widgets/anchor'; -import {Button} from '../../../widgets/button'; -import {Callout} from '../../../widgets/callout'; -import {DetailsShell} from '../../../widgets/details_shell'; -import {downloadData} from '../../../frontend/download_utils'; -import {Router} from '../../../core/router'; -import {scrollTo} from '../../scroll_helper'; -import {AppImpl} from '../../../core/app_impl'; -import {Trace} from '../../trace'; +import {Row} from '../../trace_processor/query_result'; +import {Anchor} from '../../widgets/anchor'; +import {Button} from '../../widgets/button'; +import {Callout} from '../../widgets/callout'; +import {DetailsShell} from '../../widgets/details_shell'; +import {downloadData} from '../../base/download_utils'; +import {Router} from '../../core/router'; +import {scrollTo} from '../../public/scroll_helper'; +import {AppImpl} from '../../core/app_impl'; +import {Trace} from '../../public/trace'; interface QueryTableRowAttrs { trace: Trace; diff --git a/ui/src/public/lib/query_table/query_table_unittest.ts b/ui/src/components/query_table/query_table_unittest.ts similarity index 100% rename from ui/src/public/lib/query_table/query_table_unittest.ts rename to ui/src/components/query_table/query_table_unittest.ts diff --git a/ui/src/trace_processor/sql_utils/README b/ui/src/components/sql_utils/README similarity index 100% rename from ui/src/trace_processor/sql_utils/README rename to ui/src/components/sql_utils/README diff --git a/ui/src/trace_processor/sql_utils/args.ts b/ui/src/components/sql_utils/args.ts similarity index 94% rename from ui/src/trace_processor/sql_utils/args.ts rename to ui/src/components/sql_utils/args.ts index 51aa6f8ddc..5ed66e304c 100644 --- a/ui/src/trace_processor/sql_utils/args.ts +++ b/ui/src/components/sql_utils/args.ts @@ -12,8 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {Engine} from '../engine'; -import {LONG_NULL, NUM, NUM_NULL, STR, STR_NULL} from '../query_result'; +import {Engine} from '../../trace_processor/engine'; +import { + LONG_NULL, + NUM, + NUM_NULL, + STR, + STR_NULL, +} from '../../trace_processor/query_result'; import {ArgSetId, ArgsId, asArgId} from './core_types'; export type ArgValue = bigint | string | number | boolean | null; diff --git a/ui/src/trace_processor/sql_utils/core_types.ts b/ui/src/components/sql_utils/core_types.ts similarity index 100% rename from ui/src/trace_processor/sql_utils/core_types.ts rename to ui/src/components/sql_utils/core_types.ts diff --git a/ui/src/trace_processor/sql_utils/layout.ts b/ui/src/components/sql_utils/layout.ts similarity index 100% rename from ui/src/trace_processor/sql_utils/layout.ts rename to ui/src/components/sql_utils/layout.ts diff --git a/ui/src/trace_processor/sql_utils/process.ts b/ui/src/components/sql_utils/process.ts similarity index 91% rename from ui/src/trace_processor/sql_utils/process.ts rename to ui/src/components/sql_utils/process.ts index 30c9799e74..e50f89ee6d 100644 --- a/ui/src/trace_processor/sql_utils/process.ts +++ b/ui/src/components/sql_utils/process.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {Engine} from '../engine'; -import {NUM, NUM_NULL, STR_NULL} from '../query_result'; -import {fromNumNull} from '../sql_utils'; +import {Engine} from '../../trace_processor/engine'; +import {NUM, NUM_NULL, STR_NULL} from '../../trace_processor/query_result'; +import {fromNumNull} from '../../trace_processor/sql_utils'; import {Upid} from './core_types'; // TODO(altimin): We should consider implementing some form of cache rather than querying diff --git a/ui/src/trace_processor/sql_utils/sched.ts b/ui/src/components/sql_utils/sched.ts similarity index 94% rename from ui/src/trace_processor/sql_utils/sched.ts rename to ui/src/components/sql_utils/sched.ts index 24c6c45ae9..a3859d9d0a 100644 --- a/ui/src/trace_processor/sql_utils/sched.ts +++ b/ui/src/components/sql_utils/sched.ts @@ -14,9 +14,17 @@ import {assertTrue} from '../../base/logging'; import {duration, Time, time} from '../../base/time'; -import {Engine} from '../engine'; -import {LONG, NUM, NUM_NULL, STR_NULL} from '../query_result'; -import {constraintsToQuerySuffix, SQLConstraints} from '../sql_utils'; +import {Engine} from '../../trace_processor/engine'; +import { + LONG, + NUM, + NUM_NULL, + STR_NULL, +} from '../../trace_processor/query_result'; +import { + constraintsToQuerySuffix, + SQLConstraints, +} from '../../trace_processor/sql_utils'; import { asSchedSqlId, asThreadStateSqlId, diff --git a/ui/src/trace_processor/sql_utils/slice.ts b/ui/src/components/sql_utils/slice.ts similarity index 95% rename from ui/src/trace_processor/sql_utils/slice.ts rename to ui/src/components/sql_utils/slice.ts index 17efb3dfe6..99fd61200c 100644 --- a/ui/src/trace_processor/sql_utils/slice.ts +++ b/ui/src/components/sql_utils/slice.ts @@ -14,9 +14,19 @@ import {duration, Time, time} from '../../base/time'; import {exists} from '../../base/utils'; -import {Engine} from '../engine'; -import {LONG, LONG_NULL, NUM, NUM_NULL, STR, STR_NULL} from '../query_result'; -import {constraintsToQuerySuffix, SQLConstraints} from '../sql_utils'; +import {Engine} from '../../trace_processor/engine'; +import { + LONG, + LONG_NULL, + NUM, + NUM_NULL, + STR, + STR_NULL, +} from '../../trace_processor/query_result'; +import { + constraintsToQuerySuffix, + SQLConstraints, +} from '../../trace_processor/sql_utils'; import { asArgSetId, asSliceSqlId, diff --git a/ui/src/trace_processor/sql_utils/thread.ts b/ui/src/components/sql_utils/thread.ts similarity index 91% rename from ui/src/trace_processor/sql_utils/thread.ts rename to ui/src/components/sql_utils/thread.ts index 76d907356e..e18147cb38 100644 --- a/ui/src/trace_processor/sql_utils/thread.ts +++ b/ui/src/components/sql_utils/thread.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {Engine} from '../engine'; -import {NUM, NUM_NULL, STR_NULL} from '../query_result'; -import {fromNumNull} from '../sql_utils'; +import {Engine} from '../../trace_processor/engine'; +import {NUM, NUM_NULL, STR_NULL} from '../../trace_processor/query_result'; +import {fromNumNull} from '../../trace_processor/sql_utils'; import {ProcessInfo, getProcessInfo, getProcessName} from './process'; import {Upid, Utid} from './core_types'; diff --git a/ui/src/trace_processor/sql_utils/thread_state.ts b/ui/src/components/sql_utils/thread_state.ts similarity index 96% rename from ui/src/trace_processor/sql_utils/thread_state.ts rename to ui/src/components/sql_utils/thread_state.ts index cc10a5f374..7bf5c872bb 100644 --- a/ui/src/trace_processor/sql_utils/thread_state.ts +++ b/ui/src/components/sql_utils/thread_state.ts @@ -13,13 +13,18 @@ // limitations under the License. import {duration, Time, time} from '../../base/time'; -import {Engine} from '../engine'; -import {LONG, NUM, NUM_NULL, STR_NULL} from '../query_result'; +import {Engine} from '../../trace_processor/engine'; +import { + LONG, + NUM, + NUM_NULL, + STR_NULL, +} from '../../trace_processor/query_result'; import { constraintsToQuerySuffix, fromNumNull, SQLConstraints, -} from '../sql_utils'; +} from '../../trace_processor/sql_utils'; import { asThreadStateSqlId, asUtid, diff --git a/ui/src/public/lib/time_utils.ts b/ui/src/components/time_utils.ts similarity index 92% rename from ui/src/public/lib/time_utils.ts rename to ui/src/components/time_utils.ts index 30a3c6aecd..da1991cc17 100644 --- a/ui/src/public/lib/time_utils.ts +++ b/ui/src/components/time_utils.ts @@ -13,9 +13,9 @@ // limitations under the License. import m from 'mithril'; -import {Duration, duration, time, Time} from '../../base/time'; -import {Trace} from '../trace'; -import {DurationPrecision, TimestampFormat} from '../timeline'; +import {Duration, duration, time, Time} from '../base/time'; +import {Trace} from '../public/trace'; +import {DurationPrecision, TimestampFormat} from '../public/timeline'; export function renderTimecode(time: time) { const {dhhmmss, millis, micros, nanos} = Time.toTimecode(time); diff --git a/ui/src/public/lib/tracks/add_debug_track_menu.ts b/ui/src/components/tracks/add_debug_track_menu.ts similarity index 96% rename from ui/src/public/lib/tracks/add_debug_track_menu.ts rename to ui/src/components/tracks/add_debug_track_menu.ts index 19eef1987f..0870eae38d 100644 --- a/ui/src/public/lib/tracks/add_debug_track_menu.ts +++ b/ui/src/components/tracks/add_debug_track_menu.ts @@ -13,16 +13,16 @@ // limitations under the License. import m from 'mithril'; -import {findRef} from '../../../base/dom_utils'; -import {Form, FormLabel} from '../../../widgets/form'; -import {Select} from '../../../widgets/select'; -import {TextInput} from '../../../widgets/text_input'; +import {findRef} from '../../base/dom_utils'; +import {Form, FormLabel} from '../../widgets/form'; +import {Select} from '../../widgets/select'; +import {TextInput} from '../../widgets/text_input'; import { addDebugCounterTrack, addDebugSliceTrack, addPivotedTracks, } from './debug_tracks'; -import {Trace} from '../../trace'; +import {Trace} from '../../public/trace'; import {SliceColumnMapping, SqlDataSource} from './query_slice_track'; import {CounterColumnMapping} from './query_counter_track'; diff --git a/ui/src/frontend/base_counter_track.ts b/ui/src/components/tracks/base_counter_track.ts similarity index 96% rename from ui/src/frontend/base_counter_track.ts rename to ui/src/components/tracks/base_counter_track.ts index 2bea9d910d..1c5b705bfd 100644 --- a/ui/src/frontend/base_counter_track.ts +++ b/ui/src/components/tracks/base_counter_track.ts @@ -13,20 +13,20 @@ // limitations under the License. import m from 'mithril'; -import {searchSegment} from '../base/binary_search'; -import {assertTrue, assertUnreachable} from '../base/logging'; -import {Time, time} from '../base/time'; -import {uuidv4Sql} from '../base/uuid'; -import {drawTrackHoverTooltip} from '../base/canvas_utils'; -import {raf} from '../core/raf_scheduler'; -import {CacheKey} from '../core/timeline_cache'; -import {Track, TrackMouseEvent, TrackRenderContext} from '../public/track'; -import {Button} from '../widgets/button'; -import {MenuDivider, MenuItem, PopupMenu2} from '../widgets/menu'; -import {LONG, NUM} from '../trace_processor/query_result'; -import {checkerboardExcept} from './checkerboard'; -import {AsyncDisposableStack} from '../base/disposable_stack'; -import {Trace} from '../public/trace'; +import {searchSegment} from '../../base/binary_search'; +import {assertTrue, assertUnreachable} from '../../base/logging'; +import {Time, time} from '../../base/time'; +import {uuidv4Sql} from '../../base/uuid'; +import {drawTrackHoverTooltip} from '../../base/canvas_utils'; +import {raf} from '../../core/raf_scheduler'; +import {CacheKey} from './timeline_cache'; +import {Track, TrackMouseEvent, TrackRenderContext} from '../../public/track'; +import {Button} from '../../widgets/button'; +import {MenuDivider, MenuItem, PopupMenu2} from '../../widgets/menu'; +import {LONG, NUM} from '../../trace_processor/query_result'; +import {checkerboardExcept} from '../checkerboard'; +import {AsyncDisposableStack} from '../../base/disposable_stack'; +import {Trace} from '../../public/trace'; function roundAway(n: number): number { const exp = Math.ceil(Math.log10(Math.max(Math.abs(n), 1))); diff --git a/ui/src/frontend/base_slice_track.ts b/ui/src/components/tracks/base_slice_track.ts similarity index 96% rename from ui/src/frontend/base_slice_track.ts rename to ui/src/components/tracks/base_slice_track.ts index 83c9d7360a..3f806691bf 100644 --- a/ui/src/frontend/base_slice_track.ts +++ b/ui/src/components/tracks/base_slice_track.ts @@ -12,29 +12,32 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {assertExists} from '../base/logging'; -import {clamp, floatEqual} from '../base/math_utils'; -import {Duration, Time, time} from '../base/time'; -import {exists} from '../base/utils'; -import {drawIncompleteSlice, drawTrackHoverTooltip} from '../base/canvas_utils'; -import {cropText} from '../base/string_utils'; -import {colorCompare} from '../public/color'; -import {UNEXPECTED_PINK} from '../public/lib/colorizer'; -import {TrackEventDetails} from '../public/selection'; -import {featureFlags} from '../core/feature_flags'; -import {raf} from '../core/raf_scheduler'; -import {Track} from '../public/track'; -import {Slice} from '../public/track'; -import {LONG, NUM} from '../trace_processor/query_result'; -import {checkerboardExcept} from './checkerboard'; +import {assertExists} from '../../base/logging'; +import {clamp, floatEqual} from '../../base/math_utils'; +import {Duration, Time, time} from '../../base/time'; +import {exists} from '../../base/utils'; +import { + drawIncompleteSlice, + drawTrackHoverTooltip, +} from '../../base/canvas_utils'; +import {cropText} from '../../base/string_utils'; +import {colorCompare} from '../../public/color'; +import {UNEXPECTED_PINK} from '../colorizer'; +import {TrackEventDetails} from '../../public/selection'; +import {featureFlags} from '../../core/feature_flags'; +import {raf} from '../../core/raf_scheduler'; +import {Track} from '../../public/track'; +import {Slice} from '../../public/track'; +import {LONG, NUM} from '../../trace_processor/query_result'; +import {checkerboardExcept} from '../checkerboard'; import {DEFAULT_SLICE_LAYOUT, SliceLayout} from './slice_layout'; -import {BUCKETS_PER_PIXEL, CacheKey} from '../core/timeline_cache'; -import {uuidv4Sql} from '../base/uuid'; -import {AsyncDisposableStack} from '../base/disposable_stack'; -import {TrackMouseEvent, TrackRenderContext} from '../public/track'; -import {Point2D, VerticalBounds} from '../base/geom'; -import {Trace} from '../public/trace'; -import {SourceDataset, Dataset} from '../trace_processor/dataset'; +import {BUCKETS_PER_PIXEL, CacheKey} from './timeline_cache'; +import {uuidv4Sql} from '../../base/uuid'; +import {AsyncDisposableStack} from '../../base/disposable_stack'; +import {TrackMouseEvent, TrackRenderContext} from '../../public/track'; +import {Point2D, VerticalBounds} from '../../base/geom'; +import {Trace} from '../../public/trace'; +import {SourceDataset, Dataset} from '../../trace_processor/dataset'; // The common class that underpins all tracks drawing slices. diff --git a/ui/src/frontend/base_slice_track_unittest.ts b/ui/src/components/tracks/base_slice_track_unittest.ts similarity index 96% rename from ui/src/frontend/base_slice_track_unittest.ts rename to ui/src/components/tracks/base_slice_track_unittest.ts index 9d07e494b8..a888221d6b 100644 --- a/ui/src/frontend/base_slice_track_unittest.ts +++ b/ui/src/components/tracks/base_slice_track_unittest.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {Time} from '../base/time'; -import {UNEXPECTED_PINK} from '../public/lib/colorizer'; -import {Slice} from '../public/track'; +import {Time} from '../../base/time'; +import {UNEXPECTED_PINK} from '../colorizer'; +import {Slice} from '../../public/track'; import {filterVisibleSlicesForTesting as filterVisibleSlices} from './base_slice_track'; function slice(start: number, duration: number, depth: number = 0): Slice { diff --git a/ui/src/frontend/tracks/custom_sql_table_slice_track.ts b/ui/src/components/tracks/custom_sql_table_slice_track.ts similarity index 94% rename from ui/src/frontend/tracks/custom_sql_table_slice_track.ts rename to ui/src/components/tracks/custom_sql_table_slice_track.ts index c157267e2f..23e5624aa6 100644 --- a/ui/src/frontend/tracks/custom_sql_table_slice_track.ts +++ b/ui/src/components/tracks/custom_sql_table_slice_track.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {generateSqlWithInternalLayout} from '../../trace_processor/sql_utils/layout'; -import {NAMED_ROW, NamedRow, NamedSliceTrack} from '../named_slice_track'; +import {generateSqlWithInternalLayout} from '../sql_utils/layout'; +import {NAMED_ROW, NamedRow, NamedSliceTrack} from './named_slice_track'; import {createView} from '../../trace_processor/sql_utils'; import {Slice} from '../../public/track'; import {AsyncDisposableStack} from '../../base/disposable_stack'; diff --git a/ui/src/public/lib/tracks/debug_tracks.ts b/ui/src/components/tracks/debug_tracks.ts similarity index 96% rename from ui/src/public/lib/tracks/debug_tracks.ts rename to ui/src/components/tracks/debug_tracks.ts index 36f44661a3..a9c5cfbaac 100644 --- a/ui/src/public/lib/tracks/debug_tracks.ts +++ b/ui/src/components/tracks/debug_tracks.ts @@ -15,9 +15,9 @@ import { matchesSqlValue, sqlValueToReadableString, -} from '../../../trace_processor/sql_utils'; -import {TrackNode} from '../../workspace'; -import {Trace} from '../../trace'; +} from '../../trace_processor/sql_utils'; +import {TrackNode} from '../../public/workspace'; +import {Trace} from '../../public/trace'; import { createQuerySliceTrack, SliceColumnMapping, diff --git a/ui/src/frontend/named_slice_track.ts b/ui/src/components/tracks/named_slice_track.ts similarity index 80% rename from ui/src/frontend/named_slice_track.ts rename to ui/src/components/tracks/named_slice_track.ts index 6d79af2235..d62dd6db50 100644 --- a/ui/src/frontend/named_slice_track.ts +++ b/ui/src/components/tracks/named_slice_track.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {getColorForSlice} from '../public/lib/colorizer'; -import {TrackEventDetailsPanel} from '../public/details_panel'; -import {TrackEventSelection} from '../public/selection'; -import {Slice} from '../public/track'; -import {LONG, NUM, STR, STR_NULL} from '../trace_processor/query_result'; +import {getColorForSlice} from '../colorizer'; +import {TrackEventDetailsPanel} from '../../public/details_panel'; +import {TrackEventSelection} from '../../public/selection'; +import {Slice} from '../../public/track'; +import {LONG, NUM, STR, STR_NULL} from '../../trace_processor/query_result'; import { BASE_ROW, BaseSliceTrack, @@ -25,12 +25,12 @@ import { SLICE_FLAGS_INCOMPLETE, SLICE_FLAGS_INSTANT, } from './base_slice_track'; -import {ThreadSliceDetailsPanel} from './thread_slice_details_tab'; -import {TraceImpl} from '../core/trace_impl'; -import {assertIsInstance} from '../base/logging'; -import {SourceDataset, Dataset} from '../trace_processor/dataset'; -import {formatDuration} from '../public/lib/time_utils'; -import {Trace} from '../public/trace'; +import {ThreadSliceDetailsPanel} from '../details/thread_slice_details_tab'; +import {TraceImpl} from '../../core/trace_impl'; +import {assertIsInstance} from '../../base/logging'; +import {SourceDataset, Dataset} from '../../trace_processor/dataset'; +import {formatDuration} from '../time_utils'; +import {Trace} from '../../public/trace'; export const NAMED_ROW = { // Base columns (tsq, ts, dur, id, depth). diff --git a/ui/src/public/lib/tracks/query_counter_track.ts b/ui/src/components/tracks/query_counter_track.ts similarity index 90% rename from ui/src/public/lib/tracks/query_counter_track.ts rename to ui/src/components/tracks/query_counter_track.ts index e412f7cb42..d2dad08119 100644 --- a/ui/src/public/lib/tracks/query_counter_track.ts +++ b/ui/src/components/tracks/query_counter_track.ts @@ -12,14 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {createPerfettoTable} from '../../../trace_processor/sql_utils'; -import {Trace} from '../../trace'; -import {sqlNameSafe} from '../../../base/string_utils'; -import { - BaseCounterTrack, - CounterOptions, -} from '../../../frontend/base_counter_track'; -import {Engine} from '../../../trace_processor/engine'; +import {createPerfettoTable} from '../../trace_processor/sql_utils'; +import {Trace} from '../../public/trace'; +import {sqlNameSafe} from '../../base/string_utils'; +import {BaseCounterTrack, CounterOptions} from './base_counter_track'; +import {Engine} from '../../trace_processor/engine'; export interface QueryCounterTrackArgs { // The trace object used to run queries. diff --git a/ui/src/public/lib/tracks/query_slice_track.ts b/ui/src/components/tracks/query_slice_track.ts similarity index 93% rename from ui/src/public/lib/tracks/query_slice_track.ts rename to ui/src/components/tracks/query_slice_track.ts index c8065fbf95..bf64ae1c81 100644 --- a/ui/src/public/lib/tracks/query_slice_track.ts +++ b/ui/src/components/tracks/query_slice_track.ts @@ -15,16 +15,16 @@ import { CustomSqlTableDefConfig, CustomSqlTableSliceTrack, -} from '../../../frontend/tracks/custom_sql_table_slice_track'; +} from './custom_sql_table_slice_track'; import { ARG_PREFIX, SqlTableSliceTrackDetailsPanel, } from './sql_table_slice_track_details_tab'; -import {createPerfettoTable} from '../../../trace_processor/sql_utils'; -import {Trace} from '../../trace'; -import {TrackEventSelection} from '../../selection'; -import {sqlNameSafe} from '../../../base/string_utils'; -import {Engine} from '../../../trace_processor/engine'; +import {createPerfettoTable} from '../../trace_processor/sql_utils'; +import {Trace} from '../../public/trace'; +import {TrackEventSelection} from '../../public/selection'; +import {sqlNameSafe} from '../../base/string_utils'; +import {Engine} from '../../trace_processor/engine'; export interface QuerySliceTrackArgs { // The trace object used to run queries. diff --git a/ui/src/frontend/slice_layout.ts b/ui/src/components/tracks/slice_layout.ts similarity index 100% rename from ui/src/frontend/slice_layout.ts rename to ui/src/components/tracks/slice_layout.ts diff --git a/ui/src/public/lib/tracks/sql_table_slice_track_details_tab.ts b/ui/src/components/tracks/sql_table_slice_track_details_tab.ts similarity index 85% rename from ui/src/public/lib/tracks/sql_table_slice_track_details_tab.ts rename to ui/src/components/tracks/sql_table_slice_track_details_tab.ts index c5c19353f3..0cba1fb1fd 100644 --- a/ui/src/public/lib/tracks/sql_table_slice_track_details_tab.ts +++ b/ui/src/components/tracks/sql_table_slice_track_details_tab.ts @@ -13,17 +13,11 @@ // limitations under the License. import m from 'mithril'; -import {duration, Time, time} from '../../../base/time'; -import {hasArgs, renderArguments} from '../../../frontend/slice_args'; -import {getSlice, SliceDetails} from '../../../trace_processor/sql_utils/slice'; -import { - asSliceSqlId, - Utid, -} from '../../../trace_processor/sql_utils/core_types'; -import { - getThreadState, - ThreadState, -} from '../../../trace_processor/sql_utils/thread_state'; +import {duration, Time, time} from '../../base/time'; +import {hasArgs, renderArguments} from '../details/slice_args'; +import {getSlice, SliceDetails} from '../sql_utils/slice'; +import {asSliceSqlId, Utid} from '../sql_utils/core_types'; +import {getThreadState, ThreadState} from '../sql_utils/thread_state'; import {DurationWidget} from '../widgets/duration'; import {Timestamp} from '../widgets/timestamp'; import { @@ -32,23 +26,18 @@ import { LONG, STR, timeFromSql, -} from '../../../trace_processor/query_result'; -import {sqlValueToReadableString} from '../../../trace_processor/sql_utils'; -import {DetailsShell} from '../../../widgets/details_shell'; -import {GridLayout} from '../../../widgets/grid_layout'; -import {Section} from '../../../widgets/section'; -import { - dictToTree, - dictToTreeNodes, - Tree, - TreeNode, -} from '../../../widgets/tree'; -import {threadStateRef} from '../../../frontend/widgets/thread_state'; -import {getThreadName} from '../../../trace_processor/sql_utils/thread'; -import {getProcessName} from '../../../trace_processor/sql_utils/process'; -import {sliceRef} from '../../../frontend/widgets/slice'; -import {TrackEventDetailsPanel} from '../../details_panel'; -import {Trace} from '../../trace'; +} from '../../trace_processor/query_result'; +import {sqlValueToReadableString} from '../../trace_processor/sql_utils'; +import {DetailsShell} from '../../widgets/details_shell'; +import {GridLayout} from '../../widgets/grid_layout'; +import {Section} from '../../widgets/section'; +import {dictToTree, dictToTreeNodes, Tree, TreeNode} from '../../widgets/tree'; +import {threadStateRef} from '../widgets/thread_state'; +import {getThreadName} from '../sql_utils/thread'; +import {getProcessName} from '../sql_utils/process'; +import {sliceRef} from '../widgets/slice'; +import {TrackEventDetailsPanel} from '../../public/details_panel'; +import {Trace} from '../../public/trace'; export const ARG_PREFIX = 'arg_'; diff --git a/ui/src/frontend/thread_slice_track.ts b/ui/src/components/tracks/thread_slice_track.ts similarity index 85% rename from ui/src/frontend/thread_slice_track.ts rename to ui/src/components/tracks/thread_slice_track.ts index 10a829f304..5860deee2a 100644 --- a/ui/src/frontend/thread_slice_track.ts +++ b/ui/src/components/tracks/thread_slice_track.ts @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {BigintMath as BIMath} from '../base/bigint_math'; -import {clamp} from '../base/math_utils'; +import {BigintMath as BIMath} from '../../base/bigint_math'; +import {clamp} from '../../base/math_utils'; import {NAMED_ROW, NamedSliceTrack} from './named_slice_track'; import {SLICE_LAYOUT_FIT_CONTENT_DEFAULTS} from './slice_layout'; -import {LONG_NULL} from '../trace_processor/query_result'; -import {Slice} from '../public/track'; -import {TrackEventDetails} from '../public/selection'; -import {ThreadSliceDetailsPanel} from './thread_slice_details_tab'; -import {TraceImpl} from '../core/trace_impl'; -import {assertIsInstance} from '../base/logging'; -import {Trace} from '../public/trace'; +import {LONG_NULL} from '../../trace_processor/query_result'; +import {Slice} from '../../public/track'; +import {TrackEventDetails} from '../../public/selection'; +import {ThreadSliceDetailsPanel} from '../details/thread_slice_details_tab'; +import {TraceImpl} from '../../core/trace_impl'; +import {assertIsInstance} from '../../base/logging'; +import {Trace} from '../../public/trace'; export const THREAD_SLICE_ROW = { // Base columns (tsq, ts, dur, id, depth). diff --git a/ui/src/core/timeline_cache.ts b/ui/src/components/tracks/timeline_cache.ts similarity index 97% rename from ui/src/core/timeline_cache.ts rename to ui/src/components/tracks/timeline_cache.ts index a3ce96a85a..6164d0f51b 100644 --- a/ui/src/core/timeline_cache.ts +++ b/ui/src/components/tracks/timeline_cache.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {BigintMath} from '../base/bigint_math'; -import {duration, time, Time} from '../base/time'; +import {BigintMath} from '../../base/bigint_math'; +import {duration, time, Time} from '../../base/time'; export const BUCKETS_PER_PIXEL = 2; diff --git a/ui/src/core/timeline_cache_unittest.ts b/ui/src/components/tracks/timeline_cache_unittest.ts similarity index 96% rename from ui/src/core/timeline_cache_unittest.ts rename to ui/src/components/tracks/timeline_cache_unittest.ts index b8d8dc332f..e3bba3099f 100644 --- a/ui/src/core/timeline_cache_unittest.ts +++ b/ui/src/components/tracks/timeline_cache_unittest.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {Time} from '../base/time'; +import {Time} from '../../base/time'; import {CacheKey} from './timeline_cache'; test('cacheKeys', () => { diff --git a/ui/src/common/track_data.ts b/ui/src/components/tracks/track_data.ts similarity index 94% rename from ui/src/common/track_data.ts rename to ui/src/components/tracks/track_data.ts index bb74ccc4f5..5b8d2358d0 100644 --- a/ui/src/common/track_data.ts +++ b/ui/src/components/tracks/track_data.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {duration, time} from '../base/time'; +import {duration, time} from '../../base/time'; // TODO(hjd): Refactor into method on TrackController export const LIMIT = 10000; diff --git a/ui/src/common/track_helper.ts b/ui/src/components/tracks/track_helper.ts similarity index 93% rename from ui/src/common/track_helper.ts rename to ui/src/components/tracks/track_helper.ts index e9ef6fbaa8..ab211b0fe1 100644 --- a/ui/src/common/track_helper.ts +++ b/ui/src/components/tracks/track_helper.ts @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {BigintMath} from '../base/bigint_math'; -import {duration, Time, time, TimeSpan} from '../base/time'; -export {Store} from '../base/store'; -import {raf} from '../core/raf_scheduler'; +import {BigintMath} from '../../base/bigint_math'; +import {duration, Time, time, TimeSpan} from '../../base/time'; +export {Store} from '../../base/store'; +import {raf} from '../../core/raf_scheduler'; type FetchTimeline = ( start: time, diff --git a/ui/src/frontend/visualized_args_track.ts b/ui/src/components/tracks/visualized_args_track.ts similarity index 91% rename from ui/src/frontend/visualized_args_track.ts rename to ui/src/components/tracks/visualized_args_track.ts index 4b52b9de0a..cf7c33f1ff 100644 --- a/ui/src/frontend/visualized_args_track.ts +++ b/ui/src/components/tracks/visualized_args_track.ts @@ -13,12 +13,12 @@ // limitations under the License. import m from 'mithril'; -import {Button} from '../widgets/button'; -import {Icons} from '../base/semantic_icons'; +import {Button} from '../../widgets/button'; +import {Icons} from '../../base/semantic_icons'; import {ThreadSliceTrack} from './thread_slice_track'; -import {uuidv4Sql} from '../base/uuid'; -import {createView} from '../trace_processor/sql_utils'; -import {Trace} from '../public/trace'; +import {uuidv4Sql} from '../../base/uuid'; +import {createView} from '../../trace_processor/sql_utils'; +import {Trace} from '../../public/trace'; export interface VisualizedArgsTrackAttrs { readonly uri: string; diff --git a/ui/src/frontend/visualized_args_tracks.ts b/ui/src/components/tracks/visualized_args_tracks.ts similarity index 92% rename from ui/src/frontend/visualized_args_tracks.ts rename to ui/src/components/tracks/visualized_args_tracks.ts index 985d090afb..9e23edd259 100644 --- a/ui/src/frontend/visualized_args_tracks.ts +++ b/ui/src/components/tracks/visualized_args_tracks.ts @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {uuidv4} from '../base/uuid'; -import {NUM} from '../trace_processor/query_result'; +import {uuidv4} from '../../base/uuid'; +import {NUM} from '../../trace_processor/query_result'; import {VisualizedArgsTrack} from './visualized_args_track'; -import {TrackNode} from '../public/workspace'; -import {Trace} from '../public/trace'; -import {SLICE_TRACK_KIND} from '../public/track_kinds'; +import {TrackNode} from '../../public/workspace'; +import {Trace} from '../../public/trace'; +import {SLICE_TRACK_KIND} from '../../public/track_kinds'; const VISUALIZED_ARGS_SLICE_TRACK_URI_PREFIX = 'perfetto.VisualizedArgs'; diff --git a/ui/src/frontend/widgets/README b/ui/src/components/widgets/README similarity index 100% rename from ui/src/frontend/widgets/README rename to ui/src/components/widgets/README diff --git a/ui/src/frontend/widgets/charts/add_chart_menu.ts b/ui/src/components/widgets/charts/add_chart_menu.ts similarity index 100% rename from ui/src/frontend/widgets/charts/add_chart_menu.ts rename to ui/src/components/widgets/charts/add_chart_menu.ts diff --git a/ui/src/frontend/widgets/charts/chart.ts b/ui/src/components/widgets/charts/chart.ts similarity index 100% rename from ui/src/frontend/widgets/charts/chart.ts rename to ui/src/components/widgets/charts/chart.ts diff --git a/ui/src/frontend/widgets/charts/chart_tab.ts b/ui/src/components/widgets/charts/chart_tab.ts similarity index 96% rename from ui/src/frontend/widgets/charts/chart_tab.ts rename to ui/src/components/widgets/charts/chart_tab.ts index 6d802e65ed..478c72d568 100644 --- a/ui/src/frontend/widgets/charts/chart_tab.ts +++ b/ui/src/components/widgets/charts/chart_tab.ts @@ -15,7 +15,7 @@ import m from 'mithril'; import {DetailsShell} from '../../../widgets/details_shell'; import {filterTitle} from '../sql/table/column'; -import {addEphemeralTab} from '../../../common/add_ephemeral_tab'; +import {addEphemeralTab} from '../../details/add_ephemeral_tab'; import {Tab} from '../../../public/tab'; import {Chart, renderChartComponent, toTitleCase} from './chart'; diff --git a/ui/src/frontend/widgets/charts/histogram/histogram.ts b/ui/src/components/widgets/charts/histogram/histogram.ts similarity index 96% rename from ui/src/frontend/widgets/charts/histogram/histogram.ts rename to ui/src/components/widgets/charts/histogram/histogram.ts index 38f4a656e9..52766cd181 100644 --- a/ui/src/frontend/widgets/charts/histogram/histogram.ts +++ b/ui/src/components/widgets/charts/histogram/histogram.ts @@ -14,7 +14,7 @@ import m from 'mithril'; import {stringifyJsonWithBigints} from '../../../../base/json_utils'; -import {VegaView} from '../../../../widgets/vega_view'; +import {VegaView} from '../../vega_view'; import {HistogramState} from './state'; import {Spinner} from '../../../../widgets/spinner'; import {ChartConfig} from '../chart'; diff --git a/ui/src/frontend/widgets/charts/histogram/state.ts b/ui/src/components/widgets/charts/histogram/state.ts similarity index 100% rename from ui/src/frontend/widgets/charts/histogram/state.ts rename to ui/src/components/widgets/charts/histogram/state.ts diff --git a/ui/src/frontend/widgets/collapsible_panel.ts b/ui/src/components/widgets/collapsible_panel.ts similarity index 98% rename from ui/src/frontend/widgets/collapsible_panel.ts rename to ui/src/components/widgets/collapsible_panel.ts index 107ac52166..d1b6afae45 100644 --- a/ui/src/frontend/widgets/collapsible_panel.ts +++ b/ui/src/components/widgets/collapsible_panel.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import m from 'mithril'; -import {DEFAULT_DETAILS_CONTENT_HEIGHT} from '../css_constants'; +import {DEFAULT_DETAILS_CONTENT_HEIGHT} from '../../frontend/css_constants'; import {DisposableStack} from '../../base/disposable_stack'; import {DragGestureHandler} from '../../base/drag_gesture_handler'; import {raf} from '../../core/raf_scheduler'; diff --git a/ui/src/public/lib/widgets/duration.ts b/ui/src/components/widgets/duration.ts similarity index 82% rename from ui/src/public/lib/widgets/duration.ts rename to ui/src/components/widgets/duration.ts index 409af5d7ed..31c1835afe 100644 --- a/ui/src/public/lib/widgets/duration.ts +++ b/ui/src/components/widgets/duration.ts @@ -13,14 +13,14 @@ // limitations under the License. import m from 'mithril'; -import {copyToClipboard} from '../../../base/clipboard'; -import {assertExists} from '../../../base/logging'; -import {Icons} from '../../../base/semantic_icons'; -import {duration} from '../../../base/time'; -import {AppImpl} from '../../../core/app_impl'; -import {Anchor} from '../../../widgets/anchor'; -import {MenuDivider, MenuItem, PopupMenu2} from '../../../widgets/menu'; -import {Trace} from '../../trace'; +import {copyToClipboard} from '../../base/clipboard'; +import {assertExists} from '../../base/logging'; +import {Icons} from '../../base/semantic_icons'; +import {duration} from '../../base/time'; +import {AppImpl} from '../../core/app_impl'; +import {Anchor} from '../../widgets/anchor'; +import {MenuDivider, MenuItem, PopupMenu2} from '../../widgets/menu'; +import {Trace} from '../../public/trace'; import {formatDuration} from '../time_utils'; import {DurationPrecisionMenuItem} from './duration_precision_menu_items'; import {TimestampFormatMenuItem} from './timestamp_format_menu'; diff --git a/ui/src/public/lib/widgets/duration_precision_menu_items.ts b/ui/src/components/widgets/duration_precision_menu_items.ts similarity index 91% rename from ui/src/public/lib/widgets/duration_precision_menu_items.ts rename to ui/src/components/widgets/duration_precision_menu_items.ts index 666acbace2..7a332f8b19 100644 --- a/ui/src/public/lib/widgets/duration_precision_menu_items.ts +++ b/ui/src/components/widgets/duration_precision_menu_items.ts @@ -13,9 +13,9 @@ // limitations under the License. import m from 'mithril'; -import {MenuItem} from '../../../widgets/menu'; -import {Trace} from '../../trace'; -import {DurationPrecision, TimestampFormat} from '../../timeline'; +import {MenuItem} from '../../widgets/menu'; +import {Trace} from '../../public/trace'; +import {DurationPrecision, TimestampFormat} from '../../public/timeline'; interface DurationPrecisionMenuItemAttrs { trace: Trace; diff --git a/ui/src/frontend/widgets/process.ts b/ui/src/components/widgets/process.ts similarity index 88% rename from ui/src/frontend/widgets/process.ts rename to ui/src/components/widgets/process.ts index 0738005009..fee1d7c53e 100644 --- a/ui/src/frontend/widgets/process.ts +++ b/ui/src/components/widgets/process.ts @@ -16,21 +16,21 @@ import m from 'mithril'; import {copyToClipboard} from '../../base/clipboard'; import {Icons} from '../../base/semantic_icons'; import {exists} from '../../base/utils'; -import {addEphemeralTab} from '../../common/add_ephemeral_tab'; -import {Upid} from '../../trace_processor/sql_utils/core_types'; +import {addEphemeralTab} from '../details/add_ephemeral_tab'; +import {Upid} from '../sql_utils/core_types'; import { getProcessInfo, getProcessName, ProcessInfo, -} from '../../trace_processor/sql_utils/process'; +} from '../sql_utils/process'; import {Anchor} from '../../widgets/anchor'; import {MenuItem, PopupMenu2} from '../../widgets/menu'; -import {ProcessDetailsTab} from '../process_details_tab'; +import {ProcessDetailsTab} from '../details/process_details_tab'; import { createSqlIdRefRenderer, sqlIdRegistry, -} from './sql/details/sql_ref_renderer_registry'; -import {asUpid} from '../../trace_processor/sql_utils/core_types'; +} from '../widgets/sql/details/sql_ref_renderer_registry'; +import {asUpid} from '../sql_utils/core_types'; import {AppImpl} from '../../core/app_impl'; export function showProcessDetailsMenuItem( diff --git a/ui/src/frontend/widgets/sched.ts b/ui/src/components/widgets/sched.ts similarity index 96% rename from ui/src/frontend/widgets/sched.ts rename to ui/src/components/widgets/sched.ts index 665ca9c23c..61345c32a8 100644 --- a/ui/src/frontend/widgets/sched.ts +++ b/ui/src/components/widgets/sched.ts @@ -13,7 +13,7 @@ // limitations under the License. import m from 'mithril'; -import {SchedSqlId} from '../../trace_processor/sql_utils/core_types'; +import {SchedSqlId} from '../sql_utils/core_types'; import {Anchor} from '../../widgets/anchor'; import {Icons} from '../../base/semantic_icons'; import {AppImpl} from '../../core/app_impl'; diff --git a/ui/src/frontend/widgets/slice.ts b/ui/src/components/widgets/slice.ts similarity index 93% rename from ui/src/frontend/widgets/slice.ts rename to ui/src/components/widgets/slice.ts index 48ad80a210..ae31177948 100644 --- a/ui/src/frontend/widgets/slice.ts +++ b/ui/src/components/widgets/slice.ts @@ -13,13 +13,10 @@ // limitations under the License. import m from 'mithril'; -import { - asSliceSqlId, - SliceSqlId, -} from '../../trace_processor/sql_utils/core_types'; +import {asSliceSqlId, SliceSqlId} from '../sql_utils/core_types'; import {Anchor} from '../../widgets/anchor'; import {Icons} from '../../base/semantic_icons'; -import {getSlice, SliceDetails} from '../../trace_processor/sql_utils/slice'; +import {getSlice, SliceDetails} from '../sql_utils/slice'; import { createSqlIdRefRenderer, sqlIdRegistry, diff --git a/ui/src/frontend/widgets/sql/details/details.ts b/ui/src/components/widgets/sql/details/details.ts similarity index 98% rename from ui/src/frontend/widgets/sql/details/details.ts rename to ui/src/components/widgets/sql/details/details.ts index b05ed41919..12cc7bcc49 100644 --- a/ui/src/frontend/widgets/sql/details/details.ts +++ b/ui/src/components/widgets/sql/details/details.ts @@ -23,15 +23,15 @@ import { SqlValue, sqlValueToReadableString, } from '../../../../trace_processor/sql_utils'; -import {Arg, getArgs} from '../../../../trace_processor/sql_utils/args'; -import {asArgSetId} from '../../../../trace_processor/sql_utils/core_types'; +import {Arg, getArgs} from '../../../sql_utils/args'; +import {asArgSetId} from '../../../sql_utils/core_types'; import {Anchor} from '../../../../widgets/anchor'; import {renderError} from '../../../../widgets/error'; import {SqlRef} from '../../../../widgets/sql_ref'; import {Tree, TreeNode} from '../../../../widgets/tree'; -import {hasArgs, renderArguments} from '../../../slice_args'; -import {DurationWidget} from '../../../../public/lib/widgets/duration'; -import {Timestamp as TimestampWidget} from '../../../../public/lib/widgets/timestamp'; +import {hasArgs, renderArguments} from '../../../details/slice_args'; +import {DurationWidget} from '../../../widgets/duration'; +import {Timestamp as TimestampWidget} from '../../../widgets/timestamp'; import {sqlIdRegistry} from './sql_ref_renderer_registry'; import {Trace} from '../../../../public/trace'; diff --git a/ui/src/frontend/widgets/sql/details/sql_ref_renderer_registry.ts b/ui/src/components/widgets/sql/details/sql_ref_renderer_registry.ts similarity index 100% rename from ui/src/frontend/widgets/sql/details/sql_ref_renderer_registry.ts rename to ui/src/components/widgets/sql/details/sql_ref_renderer_registry.ts diff --git a/ui/src/frontend/widgets/sql/table/argument_selector.ts b/ui/src/components/widgets/sql/table/argument_selector.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/argument_selector.ts rename to ui/src/components/widgets/sql/table/argument_selector.ts diff --git a/ui/src/frontend/widgets/sql/table/column.ts b/ui/src/components/widgets/sql/table/column.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/column.ts rename to ui/src/components/widgets/sql/table/column.ts diff --git a/ui/src/frontend/widgets/sql/table/column_unittest.ts b/ui/src/components/widgets/sql/table/column_unittest.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/column_unittest.ts rename to ui/src/components/widgets/sql/table/column_unittest.ts diff --git a/ui/src/frontend/widgets/sql/table/query_builder.ts b/ui/src/components/widgets/sql/table/query_builder.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/query_builder.ts rename to ui/src/components/widgets/sql/table/query_builder.ts diff --git a/ui/src/frontend/widgets/sql/table/query_builder_unittest.ts b/ui/src/components/widgets/sql/table/query_builder_unittest.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/query_builder_unittest.ts rename to ui/src/components/widgets/sql/table/query_builder_unittest.ts diff --git a/ui/src/frontend/widgets/sql/table/render_cell_utils.ts b/ui/src/components/widgets/sql/table/render_cell_utils.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/render_cell_utils.ts rename to ui/src/components/widgets/sql/table/render_cell_utils.ts diff --git a/ui/src/frontend/widgets/sql/table/sql_table_registry.ts b/ui/src/components/widgets/sql/table/sql_table_registry.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/sql_table_registry.ts rename to ui/src/components/widgets/sql/table/sql_table_registry.ts diff --git a/ui/src/frontend/widgets/sql/table/state.ts b/ui/src/components/widgets/sql/table/state.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/state.ts rename to ui/src/components/widgets/sql/table/state.ts diff --git a/ui/src/frontend/widgets/sql/table/state_unittest.ts b/ui/src/components/widgets/sql/table/state_unittest.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/state_unittest.ts rename to ui/src/components/widgets/sql/table/state_unittest.ts diff --git a/ui/src/frontend/widgets/sql/table/table.ts b/ui/src/components/widgets/sql/table/table.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/table.ts rename to ui/src/components/widgets/sql/table/table.ts diff --git a/ui/src/frontend/widgets/sql/table/table_description.ts b/ui/src/components/widgets/sql/table/table_description.ts similarity index 100% rename from ui/src/frontend/widgets/sql/table/table_description.ts rename to ui/src/components/widgets/sql/table/table_description.ts diff --git a/ui/src/frontend/widgets/sql/table/well_known_columns.ts b/ui/src/components/widgets/sql/table/well_known_columns.ts similarity index 98% rename from ui/src/frontend/widgets/sql/table/well_known_columns.ts rename to ui/src/components/widgets/sql/table/well_known_columns.ts index 8ed593e228..7b656b4492 100644 --- a/ui/src/frontend/widgets/sql/table/well_known_columns.ts +++ b/ui/src/components/widgets/sql/table/well_known_columns.ts @@ -23,19 +23,22 @@ import { asThreadStateSqlId, asUpid, asUtid, -} from '../../../../trace_processor/sql_utils/core_types'; -import {getProcessName} from '../../../../trace_processor/sql_utils/process'; -import {getThreadName} from '../../../../trace_processor/sql_utils/thread'; +} from '../../../sql_utils/core_types'; +import {getProcessName} from '../../../sql_utils/process'; +import {getThreadName} from '../../../sql_utils/thread'; import {Anchor} from '../../../../widgets/anchor'; import {renderError} from '../../../../widgets/error'; import {MenuDivider, MenuItem, PopupMenu2} from '../../../../widgets/menu'; -import {DurationWidget} from '../../../../public/lib/widgets/duration'; +import {DurationWidget} from '../../../widgets/duration'; import {processRefMenuItems, showProcessDetailsMenuItem} from '../../process'; import {SchedRef} from '../../sched'; import {SliceRef} from '../../slice'; -import {showThreadDetailsMenuItem, threadRefMenuItems} from '../../thread'; +import { + showThreadDetailsMenuItem, + threadRefMenuItems, +} from '../../../widgets/thread'; import {ThreadStateRef} from '../../thread_state'; -import {Timestamp} from '../../../../public/lib/widgets/timestamp'; +import {Timestamp} from '../../timestamp'; import { AggregationConfig, SourceTable, diff --git a/ui/src/frontend/widgets/thread.ts b/ui/src/components/widgets/thread.ts similarity index 88% rename from ui/src/frontend/widgets/thread.ts rename to ui/src/components/widgets/thread.ts index 5d8018d163..ef5a367780 100644 --- a/ui/src/frontend/widgets/thread.ts +++ b/ui/src/components/widgets/thread.ts @@ -16,21 +16,17 @@ import m from 'mithril'; import {copyToClipboard} from '../../base/clipboard'; import {Icons} from '../../base/semantic_icons'; import {exists} from '../../base/utils'; -import {addEphemeralTab} from '../../common/add_ephemeral_tab'; -import { - getThreadInfo, - getThreadName, - ThreadInfo, -} from '../../trace_processor/sql_utils/thread'; +import {addEphemeralTab} from '../details/add_ephemeral_tab'; +import {getThreadInfo, getThreadName, ThreadInfo} from '../sql_utils/thread'; import {Anchor} from '../../widgets/anchor'; import {MenuItem, PopupMenu2} from '../../widgets/menu'; -import {ThreadDetailsTab} from '../thread_details_tab'; +import {ThreadDetailsTab} from '../details/thread_details_tab'; import { createSqlIdRefRenderer, sqlIdRegistry, } from './sql/details/sql_ref_renderer_registry'; -import {asUtid} from '../../trace_processor/sql_utils/core_types'; -import {Utid} from '../../trace_processor/sql_utils/core_types'; +import {asUtid} from '../sql_utils/core_types'; +import {Utid} from '../sql_utils/core_types'; import {AppImpl} from '../../core/app_impl'; export function showThreadDetailsMenuItem( diff --git a/ui/src/frontend/widgets/thread_state.ts b/ui/src/components/widgets/thread_state.ts similarity index 93% rename from ui/src/frontend/widgets/thread_state.ts rename to ui/src/components/widgets/thread_state.ts index b7cfd692f9..4c4cf6037f 100644 --- a/ui/src/frontend/widgets/thread_state.ts +++ b/ui/src/components/widgets/thread_state.ts @@ -13,10 +13,10 @@ // limitations under the License. import m from 'mithril'; -import {ThreadStateSqlId} from '../../trace_processor/sql_utils/core_types'; +import {ThreadStateSqlId} from '../sql_utils/core_types'; import {Anchor} from '../../widgets/anchor'; import {Icons} from '../../base/semantic_icons'; -import {ThreadState} from '../../trace_processor/sql_utils/thread_state'; +import {ThreadState} from '../sql_utils/thread_state'; import {AppImpl} from '../../core/app_impl'; interface ThreadStateRefAttrs { diff --git a/ui/src/public/lib/widgets/timestamp.ts b/ui/src/components/widgets/timestamp.ts similarity index 86% rename from ui/src/public/lib/widgets/timestamp.ts rename to ui/src/components/widgets/timestamp.ts index bd40218129..463c5f5c66 100644 --- a/ui/src/public/lib/widgets/timestamp.ts +++ b/ui/src/components/widgets/timestamp.ts @@ -13,17 +13,17 @@ // limitations under the License. import m from 'mithril'; -import {copyToClipboard} from '../../../base/clipboard'; -import {assertExists} from '../../../base/logging'; -import {Icons} from '../../../base/semantic_icons'; -import {time, Time} from '../../../base/time'; -import {AppImpl} from '../../../core/app_impl'; -import {Anchor} from '../../../widgets/anchor'; -import {MenuDivider, MenuItem, PopupMenu2} from '../../../widgets/menu'; -import {Trace} from '../../trace'; +import {copyToClipboard} from '../../base/clipboard'; +import {assertExists} from '../../base/logging'; +import {Icons} from '../../base/semantic_icons'; +import {time, Time} from '../../base/time'; +import {AppImpl} from '../../core/app_impl'; +import {Anchor} from '../../widgets/anchor'; +import {MenuDivider, MenuItem, PopupMenu2} from '../../widgets/menu'; +import {Trace} from '../../public/trace'; import {TimestampFormatMenuItem} from './timestamp_format_menu'; import {renderTimecode} from '../time_utils'; -import {TimestampFormat} from '../../timeline'; +import {TimestampFormat} from '../../public/timeline'; // import {MenuItem, PopupMenu2} from './menu'; diff --git a/ui/src/public/lib/widgets/timestamp_format_menu.ts b/ui/src/components/widgets/timestamp_format_menu.ts similarity index 92% rename from ui/src/public/lib/widgets/timestamp_format_menu.ts rename to ui/src/components/widgets/timestamp_format_menu.ts index 2b1a351672..121d76caa5 100644 --- a/ui/src/public/lib/widgets/timestamp_format_menu.ts +++ b/ui/src/components/widgets/timestamp_format_menu.ts @@ -13,9 +13,9 @@ // limitations under the License. import m from 'mithril'; -import {MenuItem} from '../../../widgets/menu'; -import {Trace} from '../../trace'; -import {TimestampFormat} from '../../timeline'; +import {MenuItem} from '../../widgets/menu'; +import {Trace} from '../../public/trace'; +import {TimestampFormat} from '../../public/timeline'; interface TimestampFormatMenuItemAttrs { trace: Trace; diff --git a/ui/src/frontend/widgets/treetable.ts b/ui/src/components/widgets/treetable.ts similarity index 100% rename from ui/src/frontend/widgets/treetable.ts rename to ui/src/components/widgets/treetable.ts diff --git a/ui/src/widgets/vega_view.ts b/ui/src/components/widgets/vega_view.ts similarity index 94% rename from ui/src/widgets/vega_view.ts rename to ui/src/components/widgets/vega_view.ts index 1a8cb43d95..2975d49ebd 100644 --- a/ui/src/widgets/vega_view.ts +++ b/ui/src/components/widgets/vega_view.ts @@ -15,13 +15,13 @@ import m from 'mithril'; import * as vega from 'vega'; import * as vegaLite from 'vega-lite'; -import {getErrorMessage} from '../base/errors'; -import {isString, shallowEquals} from '../base/object_utils'; -import {SimpleResizeObserver} from '../base/resize_observer'; -import {Engine} from '../trace_processor/engine'; -import {QueryError} from '../trace_processor/query_result'; -import {scheduleFullRedraw} from '../widgets/raf'; -import {Spinner} from '../widgets/spinner'; +import {getErrorMessage} from '../../base/errors'; +import {isString, shallowEquals} from '../../base/object_utils'; +import {SimpleResizeObserver} from '../../base/resize_observer'; +import {Engine} from '../../trace_processor/engine'; +import {QueryError} from '../../trace_processor/query_result'; +import {scheduleFullRedraw} from '../../widgets/raf'; +import {Spinner} from '../../widgets/spinner'; function isVegaLite(spec: unknown): boolean { if (typeof spec === 'object') { diff --git a/ui/src/frontend/cookie_consent.ts b/ui/src/core/cookie_consent.ts similarity index 95% rename from ui/src/frontend/cookie_consent.ts rename to ui/src/core/cookie_consent.ts index d7cfd8484f..471f92818d 100644 --- a/ui/src/frontend/cookie_consent.ts +++ b/ui/src/core/cookie_consent.ts @@ -13,8 +13,8 @@ // limitations under the License. import m from 'mithril'; -import {raf} from '../core/raf_scheduler'; -import {AppImpl} from '../core/app_impl'; +import {raf} from './raf_scheduler'; +import {AppImpl} from './app_impl'; const COOKIE_ACK_KEY = 'cookieAck'; diff --git a/ui/src/core/flow_manager.ts b/ui/src/core/flow_manager.ts index b93e3ab7a1..7529ef7c11 100644 --- a/ui/src/core/flow_manager.ts +++ b/ui/src/core/flow_manager.ts @@ -15,7 +15,7 @@ import {Time} from '../base/time'; import {featureFlags} from './feature_flags'; import {FlowDirection, Flow} from './flow_types'; -import {asSliceSqlId} from '../trace_processor/sql_utils/core_types'; +import {asSliceSqlId} from '../components/sql_utils/core_types'; import {LONG, NUM, STR_NULL} from '../trace_processor/query_result'; import { ACTUAL_FRAMES_SLICE_TRACK_KIND, diff --git a/ui/src/core/flow_types.ts b/ui/src/core/flow_types.ts index 5edb424e9e..31b7595fb7 100644 --- a/ui/src/core/flow_types.ts +++ b/ui/src/core/flow_types.ts @@ -13,7 +13,7 @@ // limitations under the License. import {time, duration} from '../base/time'; -import {SliceSqlId} from '../trace_processor/sql_utils/core_types'; +import {SliceSqlId} from '../components/sql_utils/core_types'; export interface Flow { id: number; diff --git a/ui/src/core/note_manager.ts b/ui/src/core/note_manager.ts index ab2249a732..20a17fe6a7 100644 --- a/ui/src/core/note_manager.ts +++ b/ui/src/core/note_manager.ts @@ -19,7 +19,7 @@ import { NoteManager, SpanNote, } from '../public/note'; -import {randomColor} from '../public/lib/colorizer'; +import {randomColor} from '../components/colorizer'; import {raf} from './raf_scheduler'; export class NoteManagerImpl implements NoteManager { diff --git a/ui/src/core/tab_manager.ts b/ui/src/core/tab_manager.ts index 4942d29066..6a7c30f83d 100644 --- a/ui/src/core/tab_manager.ts +++ b/ui/src/core/tab_manager.ts @@ -17,7 +17,7 @@ import {TabDescriptor, TabManager} from '../public/tab'; import { CollapsiblePanelVisibility, toggleVisibility, -} from '../frontend/widgets/collapsible_panel'; +} from '../components/widgets/collapsible_panel'; import {raf} from './raf_scheduler'; export interface ResolvedTab { diff --git a/ui/src/core_plugins/commands/index.ts b/ui/src/core_plugins/commands/index.ts index b937daa81f..a2cfac0aaa 100644 --- a/ui/src/core_plugins/commands/index.ts +++ b/ui/src/core_plugins/commands/index.ts @@ -23,7 +23,7 @@ import { openFileWithLegacyTraceViewer, } from '../../frontend/legacy_trace_viewer'; import {AppImpl} from '../../core/app_impl'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; const SQL_STATS = ` with first as (select started as ts from sqlstats limit 1) diff --git a/ui/src/frontend/aggregation_panel.ts b/ui/src/frontend/aggregation_panel.ts index 2e1d00f1e1..47edeabeaa 100644 --- a/ui/src/frontend/aggregation_panel.ts +++ b/ui/src/frontend/aggregation_panel.ts @@ -19,12 +19,12 @@ import { ThreadStateExtra, isEmptyData, } from '../public/aggregation'; -import {colorForState} from '../public/lib/colorizer'; -import {DurationWidget} from '../public/lib/widgets/duration'; +import {colorForState} from '../components/colorizer'; +import {DurationWidget} from '../components/widgets/duration'; import {EmptyState} from '../widgets/empty_state'; import {Anchor} from '../widgets/anchor'; import {Icons} from '../base/semantic_icons'; -import {translateState} from '../trace_processor/sql_utils/thread_state'; +import {translateState} from '../components/sql_utils/thread_state'; import {TraceImpl} from '../core/trace_impl'; export interface AggregationPanelAttrs { diff --git a/ui/src/frontend/aggregation_tab.ts b/ui/src/frontend/aggregation_tab.ts index e410a6083f..bad2bfb329 100644 --- a/ui/src/frontend/aggregation_tab.ts +++ b/ui/src/frontend/aggregation_tab.ts @@ -31,7 +31,7 @@ import { import { QueryFlamegraph, metricsFromTableOrSubquery, -} from '../public/lib/query_flamegraph'; +} from '../components/query_flamegraph'; import {DisposableStack} from '../base/disposable_stack'; import {assertExists} from '../base/logging'; import {TraceImpl} from '../core/trace_impl'; diff --git a/ui/src/frontend/index.ts b/ui/src/frontend/index.ts index 600f08b90b..dfa0f3ac08 100644 --- a/ui/src/frontend/index.ts +++ b/ui/src/frontend/index.ts @@ -42,14 +42,14 @@ import {showModal} from '../widgets/modal'; import {IdleDetector} from './idle_detector'; import {IdleDetectorWindow} from './idle_detector_interface'; import {AppImpl} from '../core/app_impl'; -import {addSqlTableTab} from './sql_table_tab'; -import {configureExtensions} from '../public/lib/extensions'; +import {addSqlTableTab} from '../components/details/sql_table_tab'; +import {configureExtensions} from '../components/extensions'; import { addDebugCounterTrack, addDebugSliceTrack, -} from '../public/lib/tracks/debug_tracks'; -import {addVisualizedArgTracks} from './visualized_args_tracks'; -import {addQueryResultsTab} from '../public/lib/query_table/query_result_tab'; +} from '../components/tracks/debug_tracks'; +import {addVisualizedArgTracks} from '../components/tracks/visualized_args_tracks'; +import {addQueryResultsTab} from '../components/query_table/query_result_tab'; import {assetSrc, initAssets} from '../base/assets'; const CSP_WS_PERMISSIVE_PORT = featureFlags.register({ diff --git a/ui/src/frontend/notes_panel.ts b/ui/src/frontend/notes_panel.ts index c4d76b7ac7..60a5be49a5 100644 --- a/ui/src/frontend/notes_panel.ts +++ b/ui/src/frontend/notes_panel.ts @@ -15,7 +15,7 @@ import m from 'mithril'; import {currentTargetOffset} from '../base/dom_utils'; import {Icons} from '../base/semantic_icons'; -import {randomColor} from '../public/lib/colorizer'; +import {randomColor} from '../components/colorizer'; import {SpanNote, Note} from '../public/note'; import {raf} from '../core/raf_scheduler'; import {Button, ButtonBar} from '../widgets/button'; @@ -23,7 +23,7 @@ import {TRACK_SHELL_WIDTH} from './css_constants'; import {getMaxMajorTicks, generateTicks, TickType} from './gridline_helper'; import {Size2D} from '../base/geom'; import {Panel} from './panel_container'; -import {Timestamp} from '../public/lib/widgets/timestamp'; +import {Timestamp} from '../components/widgets/timestamp'; import {assertUnreachable} from '../base/logging'; import {DetailsPanel} from '../public/details_panel'; import {TimeScale} from '../base/time_scale'; diff --git a/ui/src/frontend/overview_timeline_panel.ts b/ui/src/frontend/overview_timeline_panel.ts index 0d04ce2d11..0636c4b6eb 100644 --- a/ui/src/frontend/overview_timeline_panel.ts +++ b/ui/src/frontend/overview_timeline_panel.ts @@ -14,7 +14,7 @@ import m from 'mithril'; import {Duration, Time, TimeSpan, duration, time} from '../base/time'; -import {colorForCpu} from '../public/lib/colorizer'; +import {colorForCpu} from '../components/colorizer'; import {timestampFormat} from '../core/timestamp_format'; import { OVERVIEW_TIMELINE_NON_VISIBLE_COLOR, diff --git a/ui/src/frontend/pivot_table.ts b/ui/src/frontend/pivot_table.ts index 734d2a02d2..625e6b7138 100644 --- a/ui/src/frontend/pivot_table.ts +++ b/ui/src/frontend/pivot_table.ts @@ -36,14 +36,14 @@ import { } from '../core/pivot_table_query_generator'; import {ReorderableCell, ReorderableCellGroup} from './reorderable_cells'; import {AttributeModalHolder} from './tables/attribute_modal_holder'; -import {DurationWidget} from '../public/lib/widgets/duration'; -import {getSqlTableDescription} from './widgets/sql/table/sql_table_registry'; +import {DurationWidget} from '../components/widgets/duration'; +import {getSqlTableDescription} from '../components/widgets/sql/table/sql_table_registry'; import {assertExists, assertFalse} from '../base/logging'; -import {Filter, SqlColumn} from './widgets/sql/table/column'; -import {argSqlColumn} from './widgets/sql/table/well_known_columns'; +import {Filter, SqlColumn} from '../components/widgets/sql/table/column'; +import {argSqlColumn} from '../components/widgets/sql/table/well_known_columns'; import {TraceImpl} from '../core/trace_impl'; import {PivotTableManager} from '../core/pivot_table_manager'; -import {extensions} from '../public/lib/extensions'; +import {extensions} from '../components/extensions'; import {MenuItem, PopupMenu2} from '../widgets/menu'; import {Button} from '../widgets/button'; import {popupMenuIcon} from '../widgets/table'; diff --git a/ui/src/frontend/sidebar.ts b/ui/src/frontend/sidebar.ts index 9c03eb7b49..d8a8f46118 100644 --- a/ui/src/frontend/sidebar.ts +++ b/ui/src/frontend/sidebar.ts @@ -26,7 +26,7 @@ import {raf} from '../core/raf_scheduler'; import {SCM_REVISION, VERSION} from '../gen/perfetto_version'; import {showModal} from '../widgets/modal'; import {Animation} from './animation'; -import {downloadData, downloadUrl} from './download_utils'; +import {downloadData, downloadUrl} from '../base/download_utils'; import {globals} from './globals'; import {toggleHelp} from './help_modal'; import {shareTrace} from './trace_share_utils'; diff --git a/ui/src/frontend/tab_panel.ts b/ui/src/frontend/tab_panel.ts index 08a69303d2..1c6c1a575a 100644 --- a/ui/src/frontend/tab_panel.ts +++ b/ui/src/frontend/tab_panel.ts @@ -23,7 +23,7 @@ import {Tree, TreeNode} from '../widgets/tree'; import {TraceImpl, TraceImplAttrs} from '../core/trace_impl'; import {MenuItem, PopupMenu2} from '../widgets/menu'; import {Button} from '../widgets/button'; -import {CollapsiblePanel} from './widgets/collapsible_panel'; +import {CollapsiblePanel} from '../components/widgets/collapsible_panel'; export type TabPanelAttrs = TraceImplAttrs; diff --git a/ui/src/frontend/time_selection_panel.ts b/ui/src/frontend/time_selection_panel.ts index 599ed5ba06..c98f3d872d 100644 --- a/ui/src/frontend/time_selection_panel.ts +++ b/ui/src/frontend/time_selection_panel.ts @@ -26,7 +26,7 @@ import {Panel} from './panel_container'; import {canvasClip} from '../base/canvas_utils'; import {TimeScale} from '../base/time_scale'; import {TraceImpl} from '../core/trace_impl'; -import {formatDuration} from '../public/lib/time_utils'; +import {formatDuration} from '../components/time_utils'; import {TimestampFormat} from '../public/timeline'; import {assertUnreachable} from '../base/logging'; diff --git a/ui/src/frontend/ui_main.ts b/ui/src/frontend/ui_main.ts index b28a41a1ed..4a40750de5 100644 --- a/ui/src/frontend/ui_main.ts +++ b/ui/src/frontend/ui_main.ts @@ -27,10 +27,10 @@ import {Command} from '../public/command'; import {HotkeyConfig, HotkeyContext} from '../widgets/hotkey_context'; import {HotkeyGlyphs} from '../widgets/hotkey_glyphs'; import {maybeRenderFullscreenModalDialog, showModal} from '../widgets/modal'; -import {CookieConsent} from './cookie_consent'; +import {CookieConsent} from '../core/cookie_consent'; import {toggleHelp} from './help_modal'; import {Omnibox, OmniboxOption} from './omnibox'; -import {addQueryResultsTab} from '../public/lib/query_table/query_result_tab'; +import {addQueryResultsTab} from '../components/query_table/query_result_tab'; import {Sidebar} from './sidebar'; import {Topbar} from './topbar'; import {shareTrace} from './trace_share_utils'; diff --git a/ui/src/plugins/com.android.GpuWorkPeriod/index.ts b/ui/src/plugins/com.android.GpuWorkPeriod/index.ts index 1bae63293b..ce1ab1334d 100644 --- a/ui/src/plugins/com.android.GpuWorkPeriod/index.ts +++ b/ui/src/plugins/com.android.GpuWorkPeriod/index.ts @@ -17,7 +17,7 @@ import {PerfettoPlugin} from '../../public/plugin'; import {Trace} from '../../public/trace'; import {TrackNode} from '../../public/workspace'; import {SLICE_TRACK_KIND} from '../../public/track_kinds'; -import {createQuerySliceTrack} from '../../public/lib/tracks/query_slice_track'; +import {createQuerySliceTrack} from '../../components/tracks/query_slice_track'; export default class implements PerfettoPlugin { static readonly id = 'com.android.GpuWorkPeriod'; diff --git a/ui/src/plugins/com.android.InputEvents/index.ts b/ui/src/plugins/com.android.InputEvents/index.ts index b8e7184e2b..180a81cdcb 100644 --- a/ui/src/plugins/com.android.InputEvents/index.ts +++ b/ui/src/plugins/com.android.InputEvents/index.ts @@ -15,7 +15,7 @@ import {LONG} from '../../trace_processor/query_result'; import {PerfettoPlugin} from '../../public/plugin'; import {Trace} from '../../public/trace'; -import {createQuerySliceTrack} from '../../public/lib/tracks/query_slice_track'; +import {createQuerySliceTrack} from '../../components/tracks/query_slice_track'; import {TrackNode} from '../../public/workspace'; import {getOrCreateUserInteractionGroup} from '../../public/standard_groups'; diff --git a/ui/src/plugins/com.example.ExampleNestedTracks/index.ts b/ui/src/plugins/com.example.ExampleNestedTracks/index.ts index be99948ba0..da4381853a 100644 --- a/ui/src/plugins/com.example.ExampleNestedTracks/index.ts +++ b/ui/src/plugins/com.example.ExampleNestedTracks/index.ts @@ -14,7 +14,7 @@ import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {createQuerySliceTrack} from '../../public/lib/tracks/query_slice_track'; +import {createQuerySliceTrack} from '../../components/tracks/query_slice_track'; import {TrackNode} from '../../public/workspace'; export default class implements PerfettoPlugin { diff --git a/ui/src/plugins/com.example.ExampleState/index.ts b/ui/src/plugins/com.example.ExampleState/index.ts index 9e1c2960a8..b615b59d7f 100644 --- a/ui/src/plugins/com.example.ExampleState/index.ts +++ b/ui/src/plugins/com.example.ExampleState/index.ts @@ -16,7 +16,7 @@ import {createStore, Store} from '../../base/store'; import {exists} from '../../base/utils'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; interface State { counter: number; diff --git a/ui/src/plugins/com.google.PixelCpmTrace/index.ts b/ui/src/plugins/com.google.PixelCpmTrace/index.ts index dcb3934148..b05b722fef 100644 --- a/ui/src/plugins/com.google.PixelCpmTrace/index.ts +++ b/ui/src/plugins/com.google.PixelCpmTrace/index.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {createQueryCounterTrack} from '../../public/lib/tracks/query_counter_track'; +import {createQueryCounterTrack} from '../../components/tracks/query_counter_track'; import {PerfettoPlugin} from '../../public/plugin'; import {Trace} from '../../public/trace'; import {COUNTER_TRACK_KIND} from '../../public/track_kinds'; @@ -39,7 +39,7 @@ export default class implements PerfettoPlugin { `); const it = result.iter({trackId: NUM, trackName: STR}); - for (let group_added = false; it.valid(); it.next()) { + for (let groupAdded = false; it.valid(); it.next()) { const {trackId, trackName} = it; const uri = `/cpm_trace_${trackName}`; const track = await createQueryCounterTrack({ @@ -65,9 +65,9 @@ export default class implements PerfettoPlugin { track, }); group.addChildInOrder(new TrackNode({uri, title: trackName})); - if (!group_added) { + if (!groupAdded) { ctx.workspace.addChildInOrder(group); - group_added = true; + groupAdded = true; } } } diff --git a/ui/src/plugins/com.google.PixelMemory/index.ts b/ui/src/plugins/com.google.PixelMemory/index.ts index 30d15200dc..bb37be4a7e 100644 --- a/ui/src/plugins/com.google.PixelMemory/index.ts +++ b/ui/src/plugins/com.google.PixelMemory/index.ts @@ -14,7 +14,7 @@ import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {addDebugCounterTrack} from '../../public/lib/tracks/debug_tracks'; +import {addDebugCounterTrack} from '../../components/tracks/debug_tracks'; export default class implements PerfettoPlugin { static readonly id = 'com.google.PixelMemory'; diff --git a/ui/src/plugins/dev.perfetto.AndroidClientServer/index.ts b/ui/src/plugins/dev.perfetto.AndroidClientServer/index.ts index ab095b4fef..86d7c58db2 100644 --- a/ui/src/plugins/dev.perfetto.AndroidClientServer/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidClientServer/index.ts @@ -15,7 +15,7 @@ import {NUM, STR} from '../../trace_processor/query_result'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {addDebugSliceTrack} from '../../public/debug_tracks'; +import {addDebugSliceTrack} from '../../components/tracks/debug_tracks'; export default class implements PerfettoPlugin { static readonly id = 'dev.perfetto.AndroidClientServer'; diff --git a/ui/src/plugins/dev.perfetto.AndroidCujs/index.ts b/ui/src/plugins/dev.perfetto.AndroidCujs/index.ts index 2fef0d4335..ae8ed505dc 100644 --- a/ui/src/plugins/dev.perfetto.AndroidCujs/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidCujs/index.ts @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {addDebugSliceTrack} from '../../public/debug_tracks'; +import {addDebugSliceTrack} from '../../components/tracks/debug_tracks'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; /** * Adds the Debug Slice Track for given Jank CUJ name diff --git a/ui/src/plugins/dev.perfetto.AndroidDesktopMode/index.ts b/ui/src/plugins/dev.perfetto.AndroidDesktopMode/index.ts index 59f6bbf5fd..a0f6e9f7bd 100644 --- a/ui/src/plugins/dev.perfetto.AndroidDesktopMode/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidDesktopMode/index.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {createQuerySliceTrack} from '../../public/lib/tracks/query_slice_track'; +import {createQuerySliceTrack} from '../../components/tracks/query_slice_track'; import {PerfettoPlugin} from '../../public/plugin'; import {Trace} from '../../public/trace'; import {TrackNode} from '../../public/workspace'; diff --git a/ui/src/plugins/dev.perfetto.AndroidDmabuf/index.ts b/ui/src/plugins/dev.perfetto.AndroidDmabuf/index.ts index b9d0919207..d81ca130b9 100644 --- a/ui/src/plugins/dev.perfetto.AndroidDmabuf/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidDmabuf/index.ts @@ -15,7 +15,7 @@ import { createQueryCounterTrack, SqlDataSource, -} from '../../public/lib/tracks/query_counter_track'; +} from '../../components/tracks/query_counter_track'; import {PerfettoPlugin} from '../../public/plugin'; import {Trace} from '../../public/trace'; import {TrackNode} from '../../public/workspace'; diff --git a/ui/src/plugins/dev.perfetto.AndroidLog/index.ts b/ui/src/plugins/dev.perfetto.AndroidLog/index.ts index 8736fcd4f1..5b4b5dccbb 100644 --- a/ui/src/plugins/dev.perfetto.AndroidLog/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidLog/index.ts @@ -17,13 +17,13 @@ import {LogFilteringCriteria, LogPanel} from './logs_panel'; import {ANDROID_LOGS_TRACK_KIND} from '../../public/track_kinds'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {sqlTableRegistry} from '../../frontend/widgets/sql/table/sql_table_registry'; +import {sqlTableRegistry} from '../../components/widgets/sql/table/sql_table_registry'; import {NUM} from '../../trace_processor/query_result'; import {AndroidLogTrack} from './logs_track'; import {exists} from '../../base/utils'; import {TrackNode} from '../../public/workspace'; import {getAndroidLogsTable} from './table'; -import {extensions} from '../../public/lib/extensions'; +import {extensions} from '../../components/extensions'; const VERSION = 1; diff --git a/ui/src/plugins/dev.perfetto.AndroidLog/logs_panel.ts b/ui/src/plugins/dev.perfetto.AndroidLog/logs_panel.ts index 5c79fdd2ef..63d888a6df 100644 --- a/ui/src/plugins/dev.perfetto.AndroidLog/logs_panel.ts +++ b/ui/src/plugins/dev.perfetto.AndroidLog/logs_panel.ts @@ -15,7 +15,7 @@ import m from 'mithril'; import {time, Time, TimeSpan} from '../../base/time'; import {DetailsShell} from '../../widgets/details_shell'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +import {Timestamp} from '../../components/widgets/timestamp'; import {Engine} from '../../trace_processor/engine'; import {LONG, NUM, NUM_NULL, STR} from '../../trace_processor/query_result'; import {Monitor} from '../../base/monitor'; diff --git a/ui/src/plugins/dev.perfetto.AndroidLog/logs_track.ts b/ui/src/plugins/dev.perfetto.AndroidLog/logs_track.ts index 451a422a41..86998037b0 100644 --- a/ui/src/plugins/dev.perfetto.AndroidLog/logs_track.ts +++ b/ui/src/plugins/dev.perfetto.AndroidLog/logs_track.ts @@ -13,9 +13,9 @@ // limitations under the License. import {Time, duration, time} from '../../base/time'; -import {LIMIT, TrackData} from '../../common/track_data'; -import {TimelineFetcher} from '../../common/track_helper'; -import {checkerboardExcept} from '../../frontend/checkerboard'; +import {LIMIT, TrackData} from '../../components/tracks/track_data'; +import {TimelineFetcher} from '../../components/tracks/track_helper'; +import {checkerboardExcept} from '../../components/checkerboard'; import {Engine} from '../../trace_processor/engine'; import {LONG, NUM} from '../../trace_processor/query_result'; import {Track} from '../../public/track'; diff --git a/ui/src/plugins/dev.perfetto.AndroidLog/table.ts b/ui/src/plugins/dev.perfetto.AndroidLog/table.ts index bbb092629e..efd261fa38 100644 --- a/ui/src/plugins/dev.perfetto.AndroidLog/table.ts +++ b/ui/src/plugins/dev.perfetto.AndroidLog/table.ts @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {SqlTableDescription} from '../../frontend/widgets/sql/table/table_description'; +import {SqlTableDescription} from '../../components/widgets/sql/table/table_description'; import { ProcessColumnSet, StandardColumn, ThreadColumnSet, TimestampColumn, -} from '../../frontend/widgets/sql/table/well_known_columns'; +} from '../../components/widgets/sql/table/well_known_columns'; export function getAndroidLogsTable(): SqlTableDescription { return { diff --git a/ui/src/plugins/dev.perfetto.AndroidLongBatteryTracing/index.ts b/ui/src/plugins/dev.perfetto.AndroidLongBatteryTracing/index.ts index 45c471c37e..ca26f3a7e4 100644 --- a/ui/src/plugins/dev.perfetto.AndroidLongBatteryTracing/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidLongBatteryTracing/index.ts @@ -15,9 +15,9 @@ import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; import {Engine} from '../../trace_processor/engine'; -import {createQuerySliceTrack} from '../../public/lib/tracks/query_slice_track'; -import {CounterOptions} from '../../frontend/base_counter_track'; -import {createQueryCounterTrack} from '../../public/lib/tracks/query_counter_track'; +import {createQuerySliceTrack} from '../../components/tracks/query_slice_track'; +import {CounterOptions} from '../../components/tracks/base_counter_track'; +import {createQueryCounterTrack} from '../../components/tracks/query_counter_track'; import {TrackNode} from '../../public/workspace'; interface ContainedTrace { diff --git a/ui/src/plugins/dev.perfetto.AndroidNetwork/index.ts b/ui/src/plugins/dev.perfetto.AndroidNetwork/index.ts index 56e57fb1ab..e1b495fcb7 100644 --- a/ui/src/plugins/dev.perfetto.AndroidNetwork/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidNetwork/index.ts @@ -14,7 +14,7 @@ import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {addDebugSliceTrack} from '../../public/debug_tracks'; +import {addDebugSliceTrack} from '../../components/tracks/debug_tracks'; export default class implements PerfettoPlugin { static readonly id = 'dev.perfetto.AndroidNetwork'; diff --git a/ui/src/plugins/dev.perfetto.AndroidPerf/index.ts b/ui/src/plugins/dev.perfetto.AndroidPerf/index.ts index ab563280c5..c94284793e 100644 --- a/ui/src/plugins/dev.perfetto.AndroidPerf/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidPerf/index.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {addDebugSliceTrack} from '../../public/debug_tracks'; +import {addDebugSliceTrack} from '../../components/tracks/debug_tracks'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; import {getTimeSpanOfSelectionOrVisibleWindow} from '../../public/utils'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; export default class implements PerfettoPlugin { static readonly id = 'dev.perfetto.AndroidPerf'; diff --git a/ui/src/plugins/dev.perfetto.AndroidPerfTraceCounters/index.ts b/ui/src/plugins/dev.perfetto.AndroidPerfTraceCounters/index.ts index c78abf81a2..47d8df967e 100644 --- a/ui/src/plugins/dev.perfetto.AndroidPerfTraceCounters/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidPerfTraceCounters/index.ts @@ -14,8 +14,8 @@ import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {addDebugSliceTrack} from '../../public/debug_tracks'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; +import {addDebugSliceTrack} from '../../components/tracks/debug_tracks'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; const PERF_TRACE_COUNTERS_PRECONDITION = ` SELECT diff --git a/ui/src/plugins/dev.perfetto.AndroidStartup/index.ts b/ui/src/plugins/dev.perfetto.AndroidStartup/index.ts index 9ce05e4e89..38279a139d 100644 --- a/ui/src/plugins/dev.perfetto.AndroidStartup/index.ts +++ b/ui/src/plugins/dev.perfetto.AndroidStartup/index.ts @@ -15,7 +15,7 @@ import {LONG} from '../../trace_processor/query_result'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {createQuerySliceTrack} from '../../public/lib/tracks/query_slice_track'; +import {createQuerySliceTrack} from '../../components/tracks/query_slice_track'; import {TrackNode} from '../../public/workspace'; import {optimizationsTrack} from './optimizations'; diff --git a/ui/src/plugins/dev.perfetto.AndroidStartup/optimizations.ts b/ui/src/plugins/dev.perfetto.AndroidStartup/optimizations.ts index c3c91e9ff8..244387bc9e 100644 --- a/ui/src/plugins/dev.perfetto.AndroidStartup/optimizations.ts +++ b/ui/src/plugins/dev.perfetto.AndroidStartup/optimizations.ts @@ -14,7 +14,7 @@ import {Trace} from '../../public/trace'; import {STR, LONG, NUM} from '../../trace_processor/query_result'; -import {createQuerySliceTrack} from '../../public/lib/tracks/query_slice_track'; +import {createQuerySliceTrack} from '../../components/tracks/query_slice_track'; import {TrackNode} from '../../public/workspace'; // The metadata container that keeps track of optimizations for packages that have startup events. diff --git a/ui/src/plugins/dev.perfetto.AsyncSlices/async_slice_track.ts b/ui/src/plugins/dev.perfetto.AsyncSlices/async_slice_track.ts index 0d55ff1aa9..46db758e13 100644 --- a/ui/src/plugins/dev.perfetto.AsyncSlices/async_slice_track.ts +++ b/ui/src/plugins/dev.perfetto.AsyncSlices/async_slice_track.ts @@ -14,8 +14,11 @@ import {BigintMath as BIMath} from '../../base/bigint_math'; import {clamp} from '../../base/math_utils'; -import {NAMED_ROW, NamedSliceTrack} from '../../frontend/named_slice_track'; -import {SLICE_LAYOUT_FIT_CONTENT_DEFAULTS} from '../../frontend/slice_layout'; +import { + NAMED_ROW, + NamedSliceTrack, +} from '../../components/tracks/named_slice_track'; +import {SLICE_LAYOUT_FIT_CONTENT_DEFAULTS} from '../../components/tracks/slice_layout'; import {TrackEventDetails} from '../../public/selection'; import {Trace} from '../../public/trace'; import {Slice} from '../../public/track'; diff --git a/ui/src/plugins/dev.perfetto.AsyncSlices/index.ts b/ui/src/plugins/dev.perfetto.AsyncSlices/index.ts index 17e6970515..2e434fe57a 100644 --- a/ui/src/plugins/dev.perfetto.AsyncSlices/index.ts +++ b/ui/src/plugins/dev.perfetto.AsyncSlices/index.ts @@ -23,9 +23,9 @@ import {AsyncSliceTrack} from './async_slice_track'; import {exists} from '../../base/utils'; import {assertExists, assertTrue} from '../../base/logging'; import {SliceSelectionAggregator} from './slice_selection_aggregator'; -import {sqlTableRegistry} from '../../frontend/widgets/sql/table/sql_table_registry'; +import {sqlTableRegistry} from '../../components/widgets/sql/table/sql_table_registry'; import {getSliceTable} from './table'; -import {extensions} from '../../public/lib/extensions'; +import {extensions} from '../../components/extensions'; import ProcessThreadGroupsPlugin from '../dev.perfetto.ProcessThreadGroups'; export default class implements PerfettoPlugin { diff --git a/ui/src/plugins/dev.perfetto.AsyncSlices/table.ts b/ui/src/plugins/dev.perfetto.AsyncSlices/table.ts index cee67c3c33..c20d1a507e 100644 --- a/ui/src/plugins/dev.perfetto.AsyncSlices/table.ts +++ b/ui/src/plugins/dev.perfetto.AsyncSlices/table.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {SqlTableDescription} from '../../frontend/widgets/sql/table/table_description'; +import {SqlTableDescription} from '../../components/widgets/sql/table/table_description'; import { ArgSetColumnSet, DurationColumn, @@ -21,7 +21,7 @@ import { StandardColumn, ThreadColumnSet, TimestampColumn, -} from '../../frontend/widgets/sql/table/well_known_columns'; +} from '../../components/widgets/sql/table/well_known_columns'; export function getSliceTable(): SqlTableDescription { return { diff --git a/ui/src/plugins/dev.perfetto.Chaos/index.ts b/ui/src/plugins/dev.perfetto.Chaos/index.ts index 358ecca484..75e0c67f21 100644 --- a/ui/src/plugins/dev.perfetto.Chaos/index.ts +++ b/ui/src/plugins/dev.perfetto.Chaos/index.ts @@ -14,7 +14,7 @@ import {Trace} from '../../public/trace'; import {App} from '../../public/app'; -import {addDebugSliceTrack} from '../../public/debug_tracks'; +import {addDebugSliceTrack} from '../../components/tracks/debug_tracks'; import {PerfettoPlugin} from '../../public/plugin'; export default class implements PerfettoPlugin { diff --git a/ui/src/plugins/dev.perfetto.Counter/counter_details_panel.ts b/ui/src/plugins/dev.perfetto.Counter/counter_details_panel.ts index 48649e9d71..97de05760d 100644 --- a/ui/src/plugins/dev.perfetto.Counter/counter_details_panel.ts +++ b/ui/src/plugins/dev.perfetto.Counter/counter_details_panel.ts @@ -27,12 +27,12 @@ import {DetailsShell} from '../../widgets/details_shell'; import {GridLayout} from '../../widgets/grid_layout'; import {Section} from '../../widgets/section'; import {Tree, TreeNode} from '../../widgets/tree'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; -import {DurationWidget} from '../../public/lib/widgets/duration'; +import {Timestamp} from '../../components/widgets/timestamp'; +import {DurationWidget} from '../../components/widgets/duration'; import {TrackEventSelection} from '../../public/selection'; -import {hasArgs, renderArguments} from '../../frontend/slice_args'; -import {asArgSetId} from '../../trace_processor/sql_utils/core_types'; -import {Arg, getArgs} from '../../trace_processor/sql_utils/args'; +import {hasArgs, renderArguments} from '../../components/details/slice_args'; +import {asArgSetId} from '../../components/sql_utils/core_types'; +import {Arg, getArgs} from '../../components/sql_utils/args'; interface CounterDetails { // The "left" timestamp of the counter sample T(N) diff --git a/ui/src/plugins/dev.perfetto.Counter/index.ts b/ui/src/plugins/dev.perfetto.Counter/index.ts index 47a8f61235..b4624ce2fa 100644 --- a/ui/src/plugins/dev.perfetto.Counter/index.ts +++ b/ui/src/plugins/dev.perfetto.Counter/index.ts @@ -23,7 +23,7 @@ import {Trace} from '../../public/trace'; import {COUNTER_TRACK_KIND} from '../../public/track_kinds'; import {PerfettoPlugin} from '../../public/plugin'; import {getThreadUriPrefix, getTrackName} from '../../public/utils'; -import {CounterOptions} from '../../frontend/base_counter_track'; +import {CounterOptions} from '../../components/tracks/base_counter_track'; import {TraceProcessorCounterTrack} from './trace_processor_counter_track'; import {exists} from '../../base/utils'; import {TrackNode} from '../../public/workspace'; diff --git a/ui/src/plugins/dev.perfetto.Counter/trace_processor_counter_track.ts b/ui/src/plugins/dev.perfetto.Counter/trace_processor_counter_track.ts index a76fcef1da..ab046992c2 100644 --- a/ui/src/plugins/dev.perfetto.Counter/trace_processor_counter_track.ts +++ b/ui/src/plugins/dev.perfetto.Counter/trace_processor_counter_track.ts @@ -16,7 +16,7 @@ import {Time} from '../../base/time'; import { BaseCounterTrack, CounterOptions, -} from '../../frontend/base_counter_track'; +} from '../../components/tracks/base_counter_track'; import {TrackEventDetails} from '../../public/selection'; import {Trace} from '../../public/trace'; import {TrackMouseEvent} from '../../public/track'; diff --git a/ui/src/plugins/dev.perfetto.CpuFreq/cpu_freq_track.ts b/ui/src/plugins/dev.perfetto.CpuFreq/cpu_freq_track.ts index 9e59cf2275..4880341c72 100644 --- a/ui/src/plugins/dev.perfetto.CpuFreq/cpu_freq_track.ts +++ b/ui/src/plugins/dev.perfetto.CpuFreq/cpu_freq_track.ts @@ -17,10 +17,10 @@ import {searchSegment} from '../../base/binary_search'; import {assertTrue} from '../../base/logging'; import {duration, time, Time} from '../../base/time'; import {drawTrackHoverTooltip} from '../../base/canvas_utils'; -import {colorForCpu} from '../../public/lib/colorizer'; -import {TrackData} from '../../common/track_data'; -import {TimelineFetcher} from '../../common/track_helper'; -import {checkerboardExcept} from '../../frontend/checkerboard'; +import {colorForCpu} from '../../components/colorizer'; +import {TrackData} from '../../components/tracks/track_data'; +import {TimelineFetcher} from '../../components/tracks/track_helper'; +import {checkerboardExcept} from '../../components/checkerboard'; import {Track} from '../../public/track'; import {LONG, NUM} from '../../trace_processor/query_result'; import {uuidv4Sql} from '../../base/uuid'; diff --git a/ui/src/plugins/dev.perfetto.CpuProfile/cpu_profile_details_panel.ts b/ui/src/plugins/dev.perfetto.CpuProfile/cpu_profile_details_panel.ts index 91c6d2b868..2899ca94f6 100644 --- a/ui/src/plugins/dev.perfetto.CpuProfile/cpu_profile_details_panel.ts +++ b/ui/src/plugins/dev.perfetto.CpuProfile/cpu_profile_details_panel.ts @@ -17,8 +17,8 @@ import {time} from '../../base/time'; import { metricsFromTableOrSubquery, QueryFlamegraph, -} from '../../public/lib/query_flamegraph'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +} from '../../components/query_flamegraph'; +import {Timestamp} from '../../components/widgets/timestamp'; import { TrackEventDetailsPanel, TrackEventDetailsPanelSerializeArgs, diff --git a/ui/src/plugins/dev.perfetto.CpuProfile/cpu_profile_track.ts b/ui/src/plugins/dev.perfetto.CpuProfile/cpu_profile_track.ts index 0bd6fe8a4c..9735678a0c 100644 --- a/ui/src/plugins/dev.perfetto.CpuProfile/cpu_profile_track.ts +++ b/ui/src/plugins/dev.perfetto.CpuProfile/cpu_profile_track.ts @@ -14,12 +14,12 @@ import {assertExists} from '../../base/logging'; import {TrackEventDetails, TrackEventSelection} from '../../public/selection'; -import {getColorForSample} from '../../public/lib/colorizer'; +import {getColorForSample} from '../../components/colorizer'; import { BaseSliceTrack, OnSliceClickArgs, -} from '../../frontend/base_slice_track'; -import {NAMED_ROW, NamedRow} from '../../frontend/named_slice_track'; +} from '../../components/tracks/base_slice_track'; +import {NAMED_ROW, NamedRow} from '../../components/tracks/named_slice_track'; import {NUM} from '../../trace_processor/query_result'; import {Slice} from '../../public/track'; import {CpuProfileSampleFlamegraphDetailsPanel} from './cpu_profile_details_panel'; diff --git a/ui/src/plugins/dev.perfetto.CpuSlices/cpu_slice_track.ts b/ui/src/plugins/dev.perfetto.CpuSlices/cpu_slice_track.ts index 95e35b58fe..0216121e5a 100644 --- a/ui/src/plugins/dev.perfetto.CpuSlices/cpu_slice_track.ts +++ b/ui/src/plugins/dev.perfetto.CpuSlices/cpu_slice_track.ts @@ -23,21 +23,18 @@ import { } from '../../base/canvas_utils'; import {cropText} from '../../base/string_utils'; import {Color} from '../../public/color'; -import {colorForThread} from '../../public/lib/colorizer'; -import {TrackData} from '../../common/track_data'; -import {TimelineFetcher} from '../../common/track_helper'; -import {checkerboardExcept} from '../../frontend/checkerboard'; +import {colorForThread} from '../../components/colorizer'; +import {TrackData} from '../../components/tracks/track_data'; +import {TimelineFetcher} from '../../components/tracks/track_helper'; +import {checkerboardExcept} from '../../components/checkerboard'; import {Point2D} from '../../base/geom'; import {Track} from '../../public/track'; import {LONG, NUM} from '../../trace_processor/query_result'; import {uuidv4Sql} from '../../base/uuid'; import {TrackMouseEvent, TrackRenderContext} from '../../public/track'; import {TrackEventDetails} from '../../public/selection'; -import {asSchedSqlId} from '../../trace_processor/sql_utils/core_types'; -import { - getSched, - getSchedWakeupInfo, -} from '../../trace_processor/sql_utils/sched'; +import {asSchedSqlId} from '../../components/sql_utils/core_types'; +import {getSched, getSchedWakeupInfo} from '../../components/sql_utils/sched'; import {SchedSliceDetailsPanel} from './sched_details_tab'; import {Trace} from '../../public/trace'; import {exists} from '../../base/utils'; diff --git a/ui/src/plugins/dev.perfetto.CpuSlices/sched_details_tab.ts b/ui/src/plugins/dev.perfetto.CpuSlices/sched_details_tab.ts index 1aaaf1a914..e626ee3825 100644 --- a/ui/src/plugins/dev.perfetto.CpuSlices/sched_details_tab.ts +++ b/ui/src/plugins/dev.perfetto.CpuSlices/sched_details_tab.ts @@ -19,17 +19,17 @@ import {GridLayout} from '../../widgets/grid_layout'; import {Section} from '../../widgets/section'; import {SqlRef} from '../../widgets/sql_ref'; import {Tree, TreeNode} from '../../widgets/tree'; -import {DurationWidget} from '../../public/lib/widgets/duration'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; -import {asSchedSqlId} from '../../trace_processor/sql_utils/core_types'; +import {DurationWidget} from '../../components/widgets/duration'; +import {Timestamp} from '../../components/widgets/timestamp'; +import {asSchedSqlId} from '../../components/sql_utils/core_types'; import { getSched, getSchedWakeupInfo, Sched, SchedWakeupInfo, -} from '../../trace_processor/sql_utils/sched'; +} from '../../components/sql_utils/sched'; import {exists} from '../../base/utils'; -import {translateState} from '../../trace_processor/sql_utils/thread_state'; +import {translateState} from '../../components/sql_utils/thread_state'; import {Trace} from '../../public/trace'; import {TrackEventDetailsPanel} from '../../public/details_panel'; import {TrackEventSelection} from '../../public/selection'; diff --git a/ui/src/plugins/dev.perfetto.CpuidleTimeInState/index.ts b/ui/src/plugins/dev.perfetto.CpuidleTimeInState/index.ts index e180585314..63a4f22d2a 100644 --- a/ui/src/plugins/dev.perfetto.CpuidleTimeInState/index.ts +++ b/ui/src/plugins/dev.perfetto.CpuidleTimeInState/index.ts @@ -14,9 +14,9 @@ import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {CounterOptions} from '../../frontend/base_counter_track'; +import {CounterOptions} from '../../components/tracks/base_counter_track'; import {TrackNode} from '../../public/workspace'; -import {createQueryCounterTrack} from '../../public/lib/tracks/query_counter_track'; +import {createQueryCounterTrack} from '../../components/tracks/query_counter_track'; export default class implements PerfettoPlugin { static readonly id = 'dev.perfetto.CpuidleTimeInState'; diff --git a/ui/src/plugins/dev.perfetto.CriticalPath/index.ts b/ui/src/plugins/dev.perfetto.CriticalPath/index.ts index 94acec3b12..ea27ff7d5b 100644 --- a/ui/src/plugins/dev.perfetto.CriticalPath/index.ts +++ b/ui/src/plugins/dev.perfetto.CriticalPath/index.ts @@ -12,16 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { - getThreadInfo, - ThreadInfo, -} from '../../trace_processor/sql_utils/thread'; -import {addDebugSliceTrack} from '../../public/debug_tracks'; +import {getThreadInfo, ThreadInfo} from '../../components/sql_utils/thread'; +import {addDebugSliceTrack} from '../../components/tracks/debug_tracks'; import {Trace} from '../../public/trace'; import {THREAD_STATE_TRACK_KIND} from '../../public/track_kinds'; import {PerfettoPlugin} from '../../public/plugin'; -import {asUtid, Utid} from '../../trace_processor/sql_utils/core_types'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; +import {asUtid, Utid} from '../../components/sql_utils/core_types'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; import {showModal} from '../../widgets/modal'; import { CRITICAL_PATH_CMD, diff --git a/ui/src/plugins/dev.perfetto.Debug/index.ts b/ui/src/plugins/dev.perfetto.Debug/index.ts index 90d9ba21ee..d9b1ae58df 100644 --- a/ui/src/plugins/dev.perfetto.Debug/index.ts +++ b/ui/src/plugins/dev.perfetto.Debug/index.ts @@ -15,7 +15,7 @@ import { addDebugCounterTrack, addDebugSliceTrack, -} from '../../public/lib/tracks/debug_tracks'; +} from '../../components/tracks/debug_tracks'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; import {exists} from '../../base/utils'; diff --git a/ui/src/plugins/dev.perfetto.DeeplinkQuerystring/index.ts b/ui/src/plugins/dev.perfetto.DeeplinkQuerystring/index.ts index f3518543d8..8bb4cbcea9 100644 --- a/ui/src/plugins/dev.perfetto.DeeplinkQuerystring/index.ts +++ b/ui/src/plugins/dev.perfetto.DeeplinkQuerystring/index.ts @@ -19,7 +19,7 @@ import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; import {Time} from '../../base/time'; import {RouteArgs} from '../../public/route_schema'; import {App} from '../../public/app'; diff --git a/ui/src/plugins/dev.perfetto.ExplorePage/explore_page.ts b/ui/src/plugins/dev.perfetto.ExplorePage/explore_page.ts index ad3e5a959c..26b4bd89b2 100644 --- a/ui/src/plugins/dev.perfetto.ExplorePage/explore_page.ts +++ b/ui/src/plugins/dev.perfetto.ExplorePage/explore_page.ts @@ -21,15 +21,15 @@ import { StandardColumn, ThreadColumnSet, TimestampColumn, -} from '../../frontend/widgets/sql/table/well_known_columns'; -import {SqlTableState} from '../../frontend/widgets/sql/table/state'; -import {SqlTable} from '../../frontend/widgets/sql/table/table'; +} from '../../components/widgets/sql/table/well_known_columns'; +import {SqlTableState} from '../../components/widgets/sql/table/state'; +import {SqlTable} from '../../components/widgets/sql/table/table'; import {exists} from '../../base/utils'; import {Menu, MenuItem, MenuItemAttrs} from '../../widgets/menu'; import { TableColumn, TableColumnSet, -} from '../../frontend/widgets/sql/table/column'; +} from '../../components/widgets/sql/table/column'; import {Button} from '../../widgets/button'; import {Icons} from '../../base/semantic_icons'; import {DetailsShell} from '../../widgets/details_shell'; @@ -38,12 +38,12 @@ import { ChartOption, createChartConfigFromSqlTableState, renderChartComponent, -} from '../../frontend/widgets/charts/chart'; -import {AddChartMenuItem} from '../../frontend/widgets/charts/add_chart_menu'; +} from '../../components/widgets/charts/chart'; +import {AddChartMenuItem} from '../../components/widgets/charts/add_chart_menu'; import { CollapsiblePanel, CollapsiblePanelVisibility, -} from '../../frontend/widgets/collapsible_panel'; +} from '../../components/widgets/collapsible_panel'; interface ExploreTableState { sqlTableState?: SqlTableState; diff --git a/ui/src/plugins/dev.perfetto.Frames/actual_frames_track.ts b/ui/src/plugins/dev.perfetto.Frames/actual_frames_track.ts index c6ef4b3168..7bad7ddca9 100644 --- a/ui/src/plugins/dev.perfetto.Frames/actual_frames_track.ts +++ b/ui/src/plugins/dev.perfetto.Frames/actual_frames_track.ts @@ -13,10 +13,13 @@ // limitations under the License. import {HSLColor} from '../../public/color'; -import {makeColorScheme} from '../../public/lib/colorizer'; +import {makeColorScheme} from '../../components/colorizer'; import {ColorScheme} from '../../public/color_scheme'; -import {NAMED_ROW, NamedSliceTrack} from '../../frontend/named_slice_track'; -import {SLICE_LAYOUT_FIT_CONTENT_DEFAULTS} from '../../frontend/slice_layout'; +import { + NAMED_ROW, + NamedSliceTrack, +} from '../../components/tracks/named_slice_track'; +import {SLICE_LAYOUT_FIT_CONTENT_DEFAULTS} from '../../components/tracks/slice_layout'; import {STR_NULL} from '../../trace_processor/query_result'; import {Slice} from '../../public/track'; import {Trace} from '../../public/trace'; diff --git a/ui/src/plugins/dev.perfetto.Frames/expected_frames_track.ts b/ui/src/plugins/dev.perfetto.Frames/expected_frames_track.ts index 27557fcbf5..e9d75862e3 100644 --- a/ui/src/plugins/dev.perfetto.Frames/expected_frames_track.ts +++ b/ui/src/plugins/dev.perfetto.Frames/expected_frames_track.ts @@ -13,13 +13,13 @@ // limitations under the License. import {HSLColor} from '../../public/color'; -import {makeColorScheme} from '../../public/lib/colorizer'; +import {makeColorScheme} from '../../components/colorizer'; import { NAMED_ROW, NamedRow, NamedSliceTrack, -} from '../../frontend/named_slice_track'; -import {SLICE_LAYOUT_FIT_CONTENT_DEFAULTS} from '../../frontend/slice_layout'; +} from '../../components/tracks/named_slice_track'; +import {SLICE_LAYOUT_FIT_CONTENT_DEFAULTS} from '../../components/tracks/slice_layout'; import {Slice} from '../../public/track'; import {Trace} from '../../public/trace'; import {TrackEventDetails} from '../../public/selection'; diff --git a/ui/src/plugins/dev.perfetto.Ftrace/ftrace_explorer.ts b/ui/src/plugins/dev.perfetto.Ftrace/ftrace_explorer.ts index 09e45f1345..8083fb3c34 100644 --- a/ui/src/plugins/dev.perfetto.Ftrace/ftrace_explorer.ts +++ b/ui/src/plugins/dev.perfetto.Ftrace/ftrace_explorer.ts @@ -14,7 +14,7 @@ import m from 'mithril'; import {time, Time} from '../../base/time'; -import {colorForFtrace} from '../../public/lib/colorizer'; +import {colorForFtrace} from '../../components/colorizer'; import {DetailsShell} from '../../widgets/details_shell'; import { MultiSelectDiff, @@ -22,7 +22,7 @@ import { PopupMultiSelect, } from '../../widgets/multiselect'; import {PopupPosition} from '../../widgets/popup'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +import {Timestamp} from '../../components/widgets/timestamp'; import {FtraceFilter, FtraceStat} from './common'; import {Engine} from '../../trace_processor/engine'; import {LONG, NUM, STR, STR_NULL} from '../../trace_processor/query_result'; diff --git a/ui/src/plugins/dev.perfetto.Ftrace/ftrace_track.ts b/ui/src/plugins/dev.perfetto.Ftrace/ftrace_track.ts index ea87d0e000..e9696733b9 100644 --- a/ui/src/plugins/dev.perfetto.Ftrace/ftrace_track.ts +++ b/ui/src/plugins/dev.perfetto.Ftrace/ftrace_track.ts @@ -13,11 +13,11 @@ // limitations under the License. import {duration, Time, time} from '../../base/time'; -import {colorForFtrace} from '../../public/lib/colorizer'; -import {LIMIT} from '../../common/track_data'; -import {Store, TimelineFetcher} from '../../common/track_helper'; -import {checkerboardExcept} from '../../frontend/checkerboard'; -import {TrackData} from '../../common/track_data'; +import {colorForFtrace} from '../../components/colorizer'; +import {LIMIT} from '../../components/tracks/track_data'; +import {Store, TimelineFetcher} from '../../components/tracks/track_helper'; +import {checkerboardExcept} from '../../components/checkerboard'; +import {TrackData} from '../../components/tracks/track_data'; import {Engine} from '../../trace_processor/engine'; import {Track} from '../../public/track'; import {LONG, NUM, STR} from '../../trace_processor/query_result'; diff --git a/ui/src/plugins/dev.perfetto.GpuByProcess/index.ts b/ui/src/plugins/dev.perfetto.GpuByProcess/index.ts index b2264ca5dd..6f23e713d7 100644 --- a/ui/src/plugins/dev.perfetto.GpuByProcess/index.ts +++ b/ui/src/plugins/dev.perfetto.GpuByProcess/index.ts @@ -20,7 +20,7 @@ import { NAMED_ROW, NamedRow, NamedSliceTrack, -} from '../../frontend/named_slice_track'; +} from '../../components/tracks/named_slice_track'; import {TrackNode} from '../../public/workspace'; class GpuPidTrack extends NamedSliceTrack { constructor( diff --git a/ui/src/plugins/dev.perfetto.HeapProfile/heap_profile_details_panel.ts b/ui/src/plugins/dev.perfetto.HeapProfile/heap_profile_details_panel.ts index 5b4525654d..680547106b 100644 --- a/ui/src/plugins/dev.perfetto.HeapProfile/heap_profile_details_panel.ts +++ b/ui/src/plugins/dev.perfetto.HeapProfile/heap_profile_details_panel.ts @@ -19,9 +19,9 @@ import { QueryFlamegraph, QueryFlamegraphMetric, metricsFromTableOrSubquery, -} from '../../public/lib/query_flamegraph'; +} from '../../components/query_flamegraph'; import {convertTraceToPprofAndDownload} from '../../frontend/trace_converter'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +import {Timestamp} from '../../components/widgets/timestamp'; import { TrackEventDetailsPanel, TrackEventDetailsPanelSerializeArgs, diff --git a/ui/src/plugins/dev.perfetto.HeapProfile/heap_profile_track.ts b/ui/src/plugins/dev.perfetto.HeapProfile/heap_profile_track.ts index 45f1d0eebf..3d5ddce0bb 100644 --- a/ui/src/plugins/dev.perfetto.HeapProfile/heap_profile_track.ts +++ b/ui/src/plugins/dev.perfetto.HeapProfile/heap_profile_track.ts @@ -18,7 +18,7 @@ import { BaseSliceTrack, OnSliceClickArgs, OnSliceOverArgs, -} from '../../frontend/base_slice_track'; +} from '../../components/tracks/base_slice_track'; import { ProfileType, profileType, diff --git a/ui/src/plugins/dev.perfetto.MetricsPage/metrics_page.ts b/ui/src/plugins/dev.perfetto.MetricsPage/metrics_page.ts index 8f1f0f35ba..c53fd87d78 100644 --- a/ui/src/plugins/dev.perfetto.MetricsPage/metrics_page.ts +++ b/ui/src/plugins/dev.perfetto.MetricsPage/metrics_page.ts @@ -26,7 +26,7 @@ import {Engine} from '../../trace_processor/engine'; import {STR} from '../../trace_processor/query_result'; import {Select} from '../../widgets/select'; import {Spinner} from '../../widgets/spinner'; -import {VegaView} from '../../widgets/vega_view'; +import {VegaView} from '../../components/widgets/vega_view'; import {PageWithTraceAttrs} from '../../public/page'; import {assertExists} from '../../base/logging'; import {Trace} from '../../public/trace'; diff --git a/ui/src/plugins/dev.perfetto.PerfSamplesProfile/index.ts b/ui/src/plugins/dev.perfetto.PerfSamplesProfile/index.ts index 1488376dd7..23dc92c936 100644 --- a/ui/src/plugins/dev.perfetto.PerfSamplesProfile/index.ts +++ b/ui/src/plugins/dev.perfetto.PerfSamplesProfile/index.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {TrackData} from '../../common/track_data'; +import {TrackData} from '../../components/tracks/track_data'; import {PERF_SAMPLES_PROFILE_TRACK_KIND} from '../../public/track_kinds'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; diff --git a/ui/src/plugins/dev.perfetto.PerfSamplesProfile/perf_samples_profile_track.ts b/ui/src/plugins/dev.perfetto.PerfSamplesProfile/perf_samples_profile_track.ts index 5157569ed0..6b890ab10e 100644 --- a/ui/src/plugins/dev.perfetto.PerfSamplesProfile/perf_samples_profile_track.ts +++ b/ui/src/plugins/dev.perfetto.PerfSamplesProfile/perf_samples_profile_track.ts @@ -18,9 +18,9 @@ import {Slice} from '../../public/track'; import { BaseSliceTrack, OnSliceClickArgs, -} from '../../frontend/base_slice_track'; -import {NAMED_ROW, NamedRow} from '../../frontend/named_slice_track'; -import {getColorForSample} from '../../public/lib/colorizer'; +} from '../../components/tracks/base_slice_track'; +import {NAMED_ROW, NamedRow} from '../../components/tracks/named_slice_track'; +import {getColorForSample} from '../../components/colorizer'; import { ProfileType, TrackEventDetails, @@ -30,9 +30,9 @@ import {assertExists} from '../../base/logging'; import { metricsFromTableOrSubquery, QueryFlamegraph, -} from '../../public/lib/query_flamegraph'; +} from '../../components/query_flamegraph'; import {DetailsShell} from '../../widgets/details_shell'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +import {Timestamp} from '../../components/widgets/timestamp'; import {time} from '../../base/time'; import {TrackEventDetailsPanel} from '../../public/details_panel'; import {Flamegraph, FLAMEGRAPH_STATE_SCHEMA} from '../../widgets/flamegraph'; diff --git a/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/fullTraceJankMetricHandler.ts b/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/fullTraceJankMetricHandler.ts index f3704ace33..d54631e848 100644 --- a/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/fullTraceJankMetricHandler.ts +++ b/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/fullTraceJankMetricHandler.ts @@ -19,7 +19,7 @@ import { MetricHandler, } from './metricUtils'; import {Trace} from '../../../public/trace'; -import {addDebugSliceTrack} from '../../../public/debug_tracks'; +import {addDebugSliceTrack} from '../../../components/tracks/debug_tracks'; class FullTraceJankMetricHandler implements MetricHandler { /** diff --git a/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/pinBlockingCall.ts b/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/pinBlockingCall.ts index 1ae9ac6c4f..79ce9c2376 100644 --- a/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/pinBlockingCall.ts +++ b/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/pinBlockingCall.ts @@ -19,7 +19,7 @@ import { } from './metricUtils'; import {Trace} from '../../../public/trace'; import {addJankCUJDebugTrack} from '../../dev.perfetto.AndroidCujs'; -import {addDebugSliceTrack} from '../../../public/debug_tracks'; +import {addDebugSliceTrack} from '../../../components/tracks/debug_tracks'; class BlockingCallMetricHandler implements MetricHandler { /** diff --git a/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/pinCujScoped.ts b/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/pinCujScoped.ts index 5d61843135..ee54b73593 100644 --- a/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/pinCujScoped.ts +++ b/ui/src/plugins/dev.perfetto.PinAndroidPerfMetrics/handlers/pinCujScoped.ts @@ -24,7 +24,7 @@ import {Trace} from '../../../public/trace'; // TODO(primiano): make deps check stricter, we shouldn't allow plugins to // depend on each other. import {focusOnSlice} from '../../dev.perfetto.AndroidCujs/trackUtils'; -import {addDebugSliceTrack} from '../../../public/debug_tracks'; +import {addDebugSliceTrack} from '../../../components/tracks/debug_tracks'; const ENABLE_FOCUS_ON_FIRST_JANK = true; diff --git a/ui/src/plugins/dev.perfetto.Process/index.ts b/ui/src/plugins/dev.perfetto.Process/index.ts index 52ce021eb6..1104a8acb1 100644 --- a/ui/src/plugins/dev.perfetto.Process/index.ts +++ b/ui/src/plugins/dev.perfetto.Process/index.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {sqlTableRegistry} from '../../frontend/widgets/sql/table/sql_table_registry'; +import {sqlTableRegistry} from '../../components/widgets/sql/table/sql_table_registry'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; import {getProcessTable} from './table'; -import {extensions} from '../../public/lib/extensions'; +import {extensions} from '../../components/extensions'; export default class implements PerfettoPlugin { static readonly id = 'dev.perfetto.Process'; diff --git a/ui/src/plugins/dev.perfetto.Process/table.ts b/ui/src/plugins/dev.perfetto.Process/table.ts index 2bce0cdfa2..a3ab4d23aa 100644 --- a/ui/src/plugins/dev.perfetto.Process/table.ts +++ b/ui/src/plugins/dev.perfetto.Process/table.ts @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {SqlTableDescription} from '../../frontend/widgets/sql/table/table_description'; +import {SqlTableDescription} from '../../components/widgets/sql/table/table_description'; import { ArgSetColumnSet, ProcessColumn, ProcessIdColumn, StandardColumn, TimestampColumn, -} from '../../frontend/widgets/sql/table/well_known_columns'; +} from '../../components/widgets/sql/table/well_known_columns'; export function getProcessTable(): SqlTableDescription { return { diff --git a/ui/src/plugins/dev.perfetto.ProcessSummary/process_scheduling_track.ts b/ui/src/plugins/dev.perfetto.ProcessSummary/process_scheduling_track.ts index 91f3646f7c..53d0519d99 100644 --- a/ui/src/plugins/dev.perfetto.ProcessSummary/process_scheduling_track.ts +++ b/ui/src/plugins/dev.perfetto.ProcessSummary/process_scheduling_track.ts @@ -18,10 +18,10 @@ import {assertExists, assertTrue} from '../../base/logging'; import {duration, time, Time} from '../../base/time'; import {drawTrackHoverTooltip} from '../../base/canvas_utils'; import {Color} from '../../public/color'; -import {colorForThread} from '../../public/lib/colorizer'; -import {TrackData} from '../../common/track_data'; -import {TimelineFetcher} from '../../common/track_helper'; -import {checkerboardExcept} from '../../frontend/checkerboard'; +import {colorForThread} from '../../components/colorizer'; +import {TrackData} from '../../components/tracks/track_data'; +import {TimelineFetcher} from '../../components/tracks/track_helper'; +import {checkerboardExcept} from '../../components/checkerboard'; import {Track} from '../../public/track'; import {LONG, NUM, QueryResult} from '../../trace_processor/query_result'; import {uuidv4Sql} from '../../base/uuid'; diff --git a/ui/src/plugins/dev.perfetto.ProcessSummary/process_summary_track.ts b/ui/src/plugins/dev.perfetto.ProcessSummary/process_summary_track.ts index 778c068fc6..50c73eb92f 100644 --- a/ui/src/plugins/dev.perfetto.ProcessSummary/process_summary_track.ts +++ b/ui/src/plugins/dev.perfetto.ProcessSummary/process_summary_track.ts @@ -15,10 +15,10 @@ import {BigintMath} from '../../base/bigint_math'; import {assertExists, assertTrue} from '../../base/logging'; import {duration, Time, time} from '../../base/time'; -import {colorForTid} from '../../public/lib/colorizer'; -import {TrackData} from '../../common/track_data'; -import {TimelineFetcher} from '../../common/track_helper'; -import {checkerboardExcept} from '../../frontend/checkerboard'; +import {colorForTid} from '../../components/colorizer'; +import {TrackData} from '../../components/tracks/track_data'; +import {TimelineFetcher} from '../../components/tracks/track_helper'; +import {checkerboardExcept} from '../../components/checkerboard'; import {Engine} from '../../trace_processor/engine'; import {Track} from '../../public/track'; import {LONG, NUM} from '../../trace_processor/query_result'; diff --git a/ui/src/plugins/dev.perfetto.QueryPage/query_page.ts b/ui/src/plugins/dev.perfetto.QueryPage/query_page.ts index 9ceaefcbd7..62a169eff0 100644 --- a/ui/src/plugins/dev.perfetto.QueryPage/query_page.ts +++ b/ui/src/plugins/dev.perfetto.QueryPage/query_page.ts @@ -15,14 +15,14 @@ import m from 'mithril'; import {SimpleResizeObserver} from '../../base/resize_observer'; import {undoCommonChatAppReplacements} from '../../base/string_utils'; -import {QueryResponse, runQuery} from '../../public/lib/query_table/queries'; +import {QueryResponse, runQuery} from '../../components/query_table/queries'; import {Callout} from '../../widgets/callout'; import {Editor} from '../../widgets/editor'; import {PageWithTraceAttrs} from '../../public/page'; import {QueryHistoryComponent, queryHistoryStorage} from './query_history'; import {Trace, TraceAttrs} from '../../public/trace'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; -import {QueryTable} from '../../public/lib/query_table/query_table'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; +import {QueryTable} from '../../components/query_table/query_table'; interface QueryPageState { enteredText: string; diff --git a/ui/src/plugins/dev.perfetto.Sched/active_cpu_count.ts b/ui/src/plugins/dev.perfetto.Sched/active_cpu_count.ts index 02ff0b2aad..f2af6289a9 100644 --- a/ui/src/plugins/dev.perfetto.Sched/active_cpu_count.ts +++ b/ui/src/plugins/dev.perfetto.Sched/active_cpu_count.ts @@ -18,7 +18,7 @@ import {sqliteString} from '../../base/string_utils'; import { BaseCounterTrack, CounterOptions, -} from '../../frontend/base_counter_track'; +} from '../../components/tracks/base_counter_track'; import {TrackContext} from '../../public/track'; import {Button} from '../../widgets/button'; import {Trace} from '../../public/trace'; diff --git a/ui/src/plugins/dev.perfetto.Sched/index.ts b/ui/src/plugins/dev.perfetto.Sched/index.ts index 8be599d287..538aca0dba 100644 --- a/ui/src/plugins/dev.perfetto.Sched/index.ts +++ b/ui/src/plugins/dev.perfetto.Sched/index.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {sqlTableRegistry} from '../../frontend/widgets/sql/table/sql_table_registry'; +import {sqlTableRegistry} from '../../components/widgets/sql/table/sql_table_registry'; import {TrackNode} from '../../public/workspace'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; @@ -22,7 +22,7 @@ import { UninterruptibleSleepThreadCountTrack, } from './thread_count'; import {getSchedTable} from './table'; -import {extensions} from '../../public/lib/extensions'; +import {extensions} from '../../components/extensions'; export default class implements PerfettoPlugin { static readonly id = 'dev.perfetto.Sched'; diff --git a/ui/src/plugins/dev.perfetto.Sched/table.ts b/ui/src/plugins/dev.perfetto.Sched/table.ts index 9f05315dec..b238b4f9cd 100644 --- a/ui/src/plugins/dev.perfetto.Sched/table.ts +++ b/ui/src/plugins/dev.perfetto.Sched/table.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {SqlTableDescription} from '../../frontend/widgets/sql/table/table_description'; +import {SqlTableDescription} from '../../components/widgets/sql/table/table_description'; import { DurationColumn, ProcessColumnSet, @@ -20,7 +20,7 @@ import { StandardColumn, ThreadColumnSet, TimestampColumn, -} from '../../frontend/widgets/sql/table/well_known_columns'; +} from '../../components/widgets/sql/table/well_known_columns'; export function getSchedTable(): SqlTableDescription { return { diff --git a/ui/src/plugins/dev.perfetto.Sched/thread_count.ts b/ui/src/plugins/dev.perfetto.Sched/thread_count.ts index 73e7ee2537..21146cd63e 100644 --- a/ui/src/plugins/dev.perfetto.Sched/thread_count.ts +++ b/ui/src/plugins/dev.perfetto.Sched/thread_count.ts @@ -15,7 +15,7 @@ import { BaseCounterTrack, CounterOptions, -} from '../../frontend/base_counter_track'; +} from '../../components/tracks/base_counter_track'; import {Trace} from '../../public/trace'; abstract class ThreadCountTrack extends BaseCounterTrack { diff --git a/ui/src/plugins/dev.perfetto.Screenshots/screenshot_panel.ts b/ui/src/plugins/dev.perfetto.Screenshots/screenshot_panel.ts index a5424af1b1..311ff2a89e 100644 --- a/ui/src/plugins/dev.perfetto.Screenshots/screenshot_panel.ts +++ b/ui/src/plugins/dev.perfetto.Screenshots/screenshot_panel.ts @@ -15,8 +15,8 @@ import m from 'mithril'; import {assertTrue} from '../../base/logging'; import {exists} from '../../base/utils'; -import {getSlice, SliceDetails} from '../../trace_processor/sql_utils/slice'; -import {asSliceSqlId} from '../../trace_processor/sql_utils/core_types'; +import {getSlice, SliceDetails} from '../../components/sql_utils/slice'; +import {asSliceSqlId} from '../../components/sql_utils/core_types'; import {Engine} from '../../trace_processor/engine'; import {TrackEventDetailsPanel} from '../../public/details_panel'; import {TrackEventSelection} from '../../public/selection'; diff --git a/ui/src/plugins/dev.perfetto.Screenshots/screenshots_track.ts b/ui/src/plugins/dev.perfetto.Screenshots/screenshots_track.ts index 2364af338b..f80be9c4a4 100644 --- a/ui/src/plugins/dev.perfetto.Screenshots/screenshots_track.ts +++ b/ui/src/plugins/dev.perfetto.Screenshots/screenshots_track.ts @@ -15,7 +15,7 @@ import { CustomSqlTableDefConfig, CustomSqlTableSliceTrack, -} from '../../frontend/tracks/custom_sql_table_slice_track'; +} from '../../components/tracks/custom_sql_table_slice_track'; import {TrackEventSelection} from '../../public/selection'; import {ScreenshotDetailsPanel} from './screenshot_panel'; diff --git a/ui/src/plugins/dev.perfetto.SqlModules/index.ts b/ui/src/plugins/dev.perfetto.SqlModules/index.ts index a1ee8c2083..fdb06b676a 100644 --- a/ui/src/plugins/dev.perfetto.SqlModules/index.ts +++ b/ui/src/plugins/dev.perfetto.SqlModules/index.ts @@ -19,7 +19,7 @@ import {Trace} from '../../public/trace'; import {SqlModules} from './sql_modules'; import {SQL_MODULES_DOCS_SCHEMA, SqlModulesImpl} from './sql_modules_impl'; import {PromptOption} from '../../public/omnibox'; -import {addQueryResultsTab} from '../../public/lib/query_table/query_result_tab'; +import {addQueryResultsTab} from '../../components/query_table/query_result_tab'; export default class implements PerfettoPlugin { static readonly id = 'dev.perfetto.SqlModules'; diff --git a/ui/src/plugins/dev.perfetto.Thread/index.ts b/ui/src/plugins/dev.perfetto.Thread/index.ts index b57bd9d98c..fbb7b46b28 100644 --- a/ui/src/plugins/dev.perfetto.Thread/index.ts +++ b/ui/src/plugins/dev.perfetto.Thread/index.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {sqlTableRegistry} from '../../frontend/widgets/sql/table/sql_table_registry'; +import {sqlTableRegistry} from '../../components/widgets/sql/table/sql_table_registry'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; import {getThreadTable} from './table'; -import {extensions} from '../../public/lib/extensions'; +import {extensions} from '../../components/extensions'; import {ThreadDesc, ThreadMap} from '../dev.perfetto.Thread/threads'; import {NUM, NUM_NULL, STR, STR_NULL} from '../../trace_processor/query_result'; import {assertExists} from '../../base/logging'; diff --git a/ui/src/plugins/dev.perfetto.Thread/table.ts b/ui/src/plugins/dev.perfetto.Thread/table.ts index e96bc64e92..fa5d716314 100644 --- a/ui/src/plugins/dev.perfetto.Thread/table.ts +++ b/ui/src/plugins/dev.perfetto.Thread/table.ts @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {SqlTableDescription} from '../../frontend/widgets/sql/table/table_description'; +import {SqlTableDescription} from '../../components/widgets/sql/table/table_description'; import { ProcessColumnSet, StandardColumn, ThreadIdColumn, TimestampColumn, -} from '../../frontend/widgets/sql/table/well_known_columns'; +} from '../../components/widgets/sql/table/well_known_columns'; export function getThreadTable(): SqlTableDescription { return { diff --git a/ui/src/plugins/dev.perfetto.ThreadState/index.ts b/ui/src/plugins/dev.perfetto.ThreadState/index.ts index d7c23633fd..6d591b4ce1 100644 --- a/ui/src/plugins/dev.perfetto.ThreadState/index.ts +++ b/ui/src/plugins/dev.perfetto.ThreadState/index.ts @@ -20,10 +20,10 @@ import {NUM, NUM_NULL, STR_NULL} from '../../trace_processor/query_result'; import {ThreadStateTrack} from './thread_state_track'; import {removeFalsyValues} from '../../base/array_utils'; import {getThreadStateTable} from './table'; -import {sqlTableRegistry} from '../../frontend/widgets/sql/table/sql_table_registry'; +import {sqlTableRegistry} from '../../components/widgets/sql/table/sql_table_registry'; import {TrackNode} from '../../public/workspace'; import {ThreadStateSelectionAggregator} from './thread_state_selection_aggregator'; -import {extensions} from '../../public/lib/extensions'; +import {extensions} from '../../components/extensions'; import ProcessThreadGroupsPlugin from '../dev.perfetto.ProcessThreadGroups'; function uriForThreadStateTrack(upid: number | null, utid: number): string { diff --git a/ui/src/plugins/dev.perfetto.ThreadState/table.ts b/ui/src/plugins/dev.perfetto.ThreadState/table.ts index c93fb40fb5..8b01e357a7 100644 --- a/ui/src/plugins/dev.perfetto.ThreadState/table.ts +++ b/ui/src/plugins/dev.perfetto.ThreadState/table.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {SqlTableDescription} from '../../frontend/widgets/sql/table/table_description'; +import {SqlTableDescription} from '../../components/widgets/sql/table/table_description'; import { DurationColumn, ProcessColumnSet, @@ -21,7 +21,7 @@ import { ThreadColumnSet, ThreadStateIdColumn, TimestampColumn, -} from '../../frontend/widgets/sql/table/well_known_columns'; +} from '../../components/widgets/sql/table/well_known_columns'; export function getThreadStateTable(): SqlTableDescription { return { diff --git a/ui/src/plugins/dev.perfetto.ThreadState/thread_state_details_panel.ts b/ui/src/plugins/dev.perfetto.ThreadState/thread_state_details_panel.ts index 1ba8c3b954..3896e88d1e 100644 --- a/ui/src/plugins/dev.perfetto.ThreadState/thread_state_details_panel.ts +++ b/ui/src/plugins/dev.perfetto.ThreadState/thread_state_details_panel.ts @@ -21,28 +21,28 @@ import {Section} from '../../widgets/section'; import {SqlRef} from '../../widgets/sql_ref'; import {Tree, TreeNode} from '../../widgets/tree'; import {Intent} from '../../widgets/common'; -import {SchedSqlId} from '../../trace_processor/sql_utils/core_types'; +import {SchedSqlId} from '../../components/sql_utils/core_types'; import { getThreadState, getThreadStateFromConstraints, ThreadState, -} from '../../trace_processor/sql_utils/thread_state'; -import {DurationWidget} from '../../public/lib/widgets/duration'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; -import {getProcessName} from '../../trace_processor/sql_utils/process'; +} from '../../components/sql_utils/thread_state'; +import {DurationWidget} from '../../components/widgets/duration'; +import {Timestamp} from '../../components/widgets/timestamp'; +import {getProcessName} from '../../components/sql_utils/process'; import { getFullThreadName, getThreadName, -} from '../../trace_processor/sql_utils/thread'; -import {ThreadStateRef} from '../../frontend/widgets/thread_state'; +} from '../../components/sql_utils/thread'; +import {ThreadStateRef} from '../../components/widgets/thread_state'; import { CRITICAL_PATH_CMD, CRITICAL_PATH_LITE_CMD, } from '../../public/exposed_commands'; -import {goToSchedSlice} from '../../frontend/widgets/sched'; +import {goToSchedSlice} from '../../components/widgets/sched'; import {TrackEventDetailsPanel} from '../../public/details_panel'; import {Trace} from '../../public/trace'; -import {formatDuration} from '../../public/lib/time_utils'; +import {formatDuration} from '../../components/time_utils'; interface RelatedThreadStates { prev?: ThreadState; diff --git a/ui/src/plugins/dev.perfetto.ThreadState/thread_state_selection_aggregator.ts b/ui/src/plugins/dev.perfetto.ThreadState/thread_state_selection_aggregator.ts index 3794bf70e7..7e702c9ead 100644 --- a/ui/src/plugins/dev.perfetto.ThreadState/thread_state_selection_aggregator.ts +++ b/ui/src/plugins/dev.perfetto.ThreadState/thread_state_selection_aggregator.ts @@ -19,7 +19,7 @@ import {THREAD_STATE_TRACK_KIND} from '../../public/track_kinds'; import {Engine} from '../../trace_processor/engine'; import {NUM, NUM_NULL, STR_NULL} from '../../trace_processor/query_result'; import {AreaSelectionAggregator} from '../../public/selection'; -import {translateState} from '../../trace_processor/sql_utils/thread_state'; +import {translateState} from '../../components/sql_utils/thread_state'; import {TrackDescriptor} from '../../public/track'; export class ThreadStateSelectionAggregator implements AreaSelectionAggregator { diff --git a/ui/src/plugins/dev.perfetto.ThreadState/thread_state_track.ts b/ui/src/plugins/dev.perfetto.ThreadState/thread_state_track.ts index 4fdb791ff1..f775712ab5 100644 --- a/ui/src/plugins/dev.perfetto.ThreadState/thread_state_track.ts +++ b/ui/src/plugins/dev.perfetto.ThreadState/thread_state_track.ts @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {colorForState} from '../../public/lib/colorizer'; +import {colorForState} from '../../components/colorizer'; import { BASE_ROW, BaseSliceTrack, OnSliceClickArgs, -} from '../../frontend/base_slice_track'; +} from '../../components/tracks/base_slice_track'; import { SLICE_LAYOUT_FLAT_DEFAULTS, SliceLayout, -} from '../../frontend/slice_layout'; +} from '../../components/tracks/slice_layout'; import {NUM_NULL, STR} from '../../trace_processor/query_result'; import {Slice} from '../../public/track'; -import {translateState} from '../../trace_processor/sql_utils/thread_state'; +import {translateState} from '../../components/sql_utils/thread_state'; import {TrackEventDetails, TrackEventSelection} from '../../public/selection'; import {ThreadStateDetailsPanel} from './thread_state_details_panel'; import {Trace} from '../../public/trace'; diff --git a/ui/src/plugins/dev.perfetto.TraceMetadata/index.ts b/ui/src/plugins/dev.perfetto.TraceMetadata/index.ts index a10afe12ec..3e12b1cb7a 100644 --- a/ui/src/plugins/dev.perfetto.TraceMetadata/index.ts +++ b/ui/src/plugins/dev.perfetto.TraceMetadata/index.ts @@ -15,7 +15,7 @@ import {NUM} from '../../trace_processor/query_result'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; -import {createQuerySliceTrack} from '../../public/lib/tracks/query_slice_track'; +import {createQuerySliceTrack} from '../../components/tracks/query_slice_track'; import {TrackNode} from '../../public/workspace'; export default class implements PerfettoPlugin { diff --git a/ui/src/plugins/dev.perfetto.VizPage/viz_page.ts b/ui/src/plugins/dev.perfetto.VizPage/viz_page.ts index a838a99a2d..341cae65c2 100644 --- a/ui/src/plugins/dev.perfetto.VizPage/viz_page.ts +++ b/ui/src/plugins/dev.perfetto.VizPage/viz_page.ts @@ -14,7 +14,7 @@ import m from 'mithril'; import {Editor} from '../../widgets/editor'; -import {VegaView} from '../../widgets/vega_view'; +import {VegaView} from '../../components/widgets/vega_view'; import {PageWithTraceAttrs} from '../../public/page'; import {Engine} from '../../trace_processor/engine'; diff --git a/ui/src/plugins/dev.perfetto.WidgetsPage/widgets_page.ts b/ui/src/plugins/dev.perfetto.WidgetsPage/widgets_page.ts index a5ff6d71e9..1211343909 100644 --- a/ui/src/plugins/dev.perfetto.WidgetsPage/widgets_page.ts +++ b/ui/src/plugins/dev.perfetto.WidgetsPage/widgets_page.ts @@ -41,10 +41,10 @@ import {Switch} from '../../widgets/switch'; import {TextInput} from '../../widgets/text_input'; import {MultiParagraphText, TextParagraph} from '../../widgets/text_paragraph'; import {LazyTreeNode, Tree, TreeNode} from '../../widgets/tree'; -import {VegaView} from '../../widgets/vega_view'; +import {VegaView} from '../../components/widgets/vega_view'; import {PageAttrs} from '../../public/page'; import {TableShowcase} from './table_showcase'; -import {TreeTable, TreeTableAttrs} from '../../frontend/widgets/treetable'; +import {TreeTable, TreeTableAttrs} from '../../components/widgets/treetable'; import {Intent} from '../../widgets/common'; import { VirtualTable, diff --git a/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/critical_user_interaction_track.ts b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/critical_user_interaction_track.ts index d377b23e67..6d5fcaf790 100644 --- a/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/critical_user_interaction_track.ts +++ b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/critical_user_interaction_track.ts @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {NAMED_ROW} from '../../frontend/named_slice_track'; +import {NAMED_ROW} from '../../components/tracks/named_slice_track'; import {LONG, NUM, STR} from '../../trace_processor/query_result'; import {Slice} from '../../public/track'; import { CustomSqlImportConfig, CustomSqlTableDefConfig, CustomSqlTableSliceTrack, -} from '../../frontend/tracks/custom_sql_table_slice_track'; +} from '../../components/tracks/custom_sql_table_slice_track'; import {TrackEventDetails, TrackEventSelection} from '../../public/selection'; import {Duration, Time} from '../../base/time'; import {PageLoadDetailsPanel} from './page_load_details_panel'; import {StartupDetailsPanel} from './startup_details_panel'; import {WebContentInteractionPanel} from './web_content_interaction_details_panel'; -import {GenericSliceDetailsTab} from '../../frontend/generic_slice_details_tab'; +import {GenericSliceDetailsTab} from './generic_slice_details_tab'; export const CRITICAL_USER_INTERACTIONS_KIND = 'org.chromium.CriticalUserInteraction.track'; diff --git a/ui/src/frontend/generic_slice_details_tab.ts b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/generic_slice_details_tab.ts similarity index 83% rename from ui/src/frontend/generic_slice_details_tab.ts rename to ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/generic_slice_details_tab.ts index 559598168a..7fce98bd16 100644 --- a/ui/src/frontend/generic_slice_details_tab.ts +++ b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/generic_slice_details_tab.ts @@ -13,15 +13,15 @@ // limitations under the License. import m from 'mithril'; -import {TrackEventDetailsPanel} from '../public/details_panel'; -import {ColumnType} from '../trace_processor/query_result'; -import {sqlValueToReadableString} from '../trace_processor/sql_utils'; -import {DetailsShell} from '../widgets/details_shell'; -import {GridLayout} from '../widgets/grid_layout'; -import {Section} from '../widgets/section'; -import {SqlRef} from '../widgets/sql_ref'; -import {dictToTree, Tree, TreeNode} from '../widgets/tree'; -import {Trace} from '../public/trace'; +import {TrackEventDetailsPanel} from '../../public/details_panel'; +import {ColumnType} from '../../trace_processor/query_result'; +import {sqlValueToReadableString} from '../../trace_processor/sql_utils'; +import {DetailsShell} from '../../widgets/details_shell'; +import {GridLayout} from '../../widgets/grid_layout'; +import {Section} from '../../widgets/section'; +import {SqlRef} from '../../widgets/sql_ref'; +import {dictToTree, Tree, TreeNode} from '../../widgets/tree'; +import {Trace} from '../../public/trace'; export interface ColumnConfig { readonly displayName?: string; diff --git a/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/page_load_details_panel.ts b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/page_load_details_panel.ts index e2d0b54006..e3a2ee7ed5 100644 --- a/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/page_load_details_panel.ts +++ b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/page_load_details_panel.ts @@ -16,7 +16,7 @@ import m from 'mithril'; import { Details, DetailsSchema, -} from '../../frontend/widgets/sql/details/details'; +} from '../../components/widgets/sql/details/details'; import {DetailsShell} from '../../widgets/details_shell'; import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout'; import {TrackEventDetailsPanel} from '../../public/details_panel'; diff --git a/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/startup_details_panel.ts b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/startup_details_panel.ts index 813e2e6e94..773bfb9933 100644 --- a/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/startup_details_panel.ts +++ b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/startup_details_panel.ts @@ -14,15 +14,15 @@ import m from 'mithril'; import {duration, Time, time} from '../../base/time'; -import {DurationWidget} from '../../public/lib/widgets/duration'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +import {DurationWidget} from '../../components/widgets/duration'; +import {Timestamp} from '../../components/widgets/timestamp'; import {LONG, NUM, STR, STR_NULL} from '../../trace_processor/query_result'; import {DetailsShell} from '../../widgets/details_shell'; import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout'; import {Section} from '../../widgets/section'; import {SqlRef} from '../../widgets/sql_ref'; import {dictToTreeNodes, Tree} from '../../widgets/tree'; -import {asUpid, Upid} from '../../trace_processor/sql_utils/core_types'; +import {asUpid, Upid} from '../../components/sql_utils/core_types'; import {Trace} from '../../public/trace'; import {TrackEventDetailsPanel} from '../../public/details_panel'; diff --git a/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/web_content_interaction_details_panel.ts b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/web_content_interaction_details_panel.ts index 58896c2ac0..a92e163624 100644 --- a/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/web_content_interaction_details_panel.ts +++ b/ui/src/plugins/org.chromium.ChromeCriticalUserInteractions/web_content_interaction_details_panel.ts @@ -28,9 +28,9 @@ import m from 'mithril'; import {duration, Time, time} from '../../base/time'; -import {asUpid, Upid} from '../../trace_processor/sql_utils/core_types'; -import {DurationWidget} from '../../public/lib/widgets/duration'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +import {asUpid, Upid} from '../../components/sql_utils/core_types'; +import {DurationWidget} from '../../components/widgets/duration'; +import {Timestamp} from '../../components/widgets/timestamp'; import {LONG, NUM, STR} from '../../trace_processor/query_result'; import {DetailsShell} from '../../widgets/details_shell'; import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout'; diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/event_latency_details_panel.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/event_latency_details_panel.ts index 8d803e44ec..5f026dbcf1 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/event_latency_details_panel.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/event_latency_details_panel.ts @@ -14,25 +14,22 @@ import m from 'mithril'; import {Duration, duration, Time, time} from '../../base/time'; -import {hasArgs, renderArguments} from '../../frontend/slice_args'; -import {renderDetails} from '../../public/lib/details/slice_details'; +import {hasArgs, renderArguments} from '../../components/details/slice_args'; +import {renderDetails} from '../../components/details/slice_details'; import { getDescendantSliceTree, getSlice, SliceDetails, SliceTreeNode, -} from '../../trace_processor/sql_utils/slice'; -import { - asSliceSqlId, - SliceSqlId, -} from '../../trace_processor/sql_utils/core_types'; +} from '../../components/sql_utils/slice'; +import {asSliceSqlId, SliceSqlId} from '../../components/sql_utils/core_types'; import { ColumnDescriptor, Table, TableData, widgetColumn, } from '../../widgets/table'; -import {TreeTable, TreeTableAttrs} from '../../frontend/widgets/treetable'; +import {TreeTable, TreeTableAttrs} from '../../components/widgets/treetable'; import {LONG, NUM, STR} from '../../trace_processor/query_result'; import {DetailsShell} from '../../widgets/details_shell'; import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout'; @@ -47,7 +44,7 @@ import { getScrollJankCauseStage, } from './scroll_jank_cause_link_utils'; import {ScrollJankCauseMap} from './scroll_jank_cause_map'; -import {sliceRef} from '../../frontend/widgets/slice'; +import {sliceRef} from '../../components/widgets/slice'; import {JANKS_TRACK_URI, renderSliceRef} from './selection_utils'; import {TrackEventDetailsPanel} from '../../public/details_panel'; import {Trace} from '../../public/trace'; diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/event_latency_track.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/event_latency_track.ts index 03ab37211c..b0434a7fd3 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/event_latency_track.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/event_latency_track.ts @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {NamedRow} from '../../frontend/named_slice_track'; +import {NamedRow} from '../../components/tracks/named_slice_track'; import {Slice} from '../../public/track'; import { CustomSqlTableDefConfig, CustomSqlTableSliceTrack, -} from '../../frontend/tracks/custom_sql_table_slice_track'; +} from '../../components/tracks/custom_sql_table_slice_track'; import {JANK_COLOR} from './jank_colors'; import {TrackEventSelection} from '../../public/selection'; import {EventLatencySliceDetailsPanel} from './event_latency_details_panel'; diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/index.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/index.ts index 24bd4e246a..a077c0822a 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/index.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/index.ts @@ -13,7 +13,7 @@ // limitations under the License. import {uuidv4Sql} from '../../base/uuid'; -import {generateSqlWithInternalLayout} from '../../trace_processor/sql_utils/layout'; +import {generateSqlWithInternalLayout} from '../../components/sql_utils/layout'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; import {EventLatencyTrack, JANKY_LATENCY_NAME} from './event_latency_track'; diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/jank_colors.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/jank_colors.ts index f764ebf156..5f572f5039 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/jank_colors.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/jank_colors.ts @@ -13,6 +13,6 @@ // limitations under the License. import {HSLColor} from '../../public/color'; -import {makeColorScheme} from '../../public/lib/colorizer'; +import {makeColorScheme} from '../../components/colorizer'; export const JANK_COLOR = makeColorScheme(new HSLColor([343, 100, 43])); diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_delta_graph.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_delta_graph.ts index b637020691..8a9d241f84 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_delta_graph.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_delta_graph.ts @@ -16,7 +16,7 @@ import m from 'mithril'; import {duration, Time, time} from '../../base/time'; import {Engine} from '../../trace_processor/engine'; import {LONG, NUM} from '../../trace_processor/query_result'; -import {VegaView} from '../../widgets/vega_view'; +import {VegaView} from '../../components/widgets/vega_view'; const INPUT_CATEGORY = 'Input'; const PRESENTED_CATEGORY = 'Presented'; diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_details_panel.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_details_panel.ts index e9efe9710e..e68e58bdc9 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_details_panel.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_details_panel.ts @@ -21,8 +21,8 @@ import { TableData, widgetColumn, } from '../../widgets/table'; -import {DurationWidget} from '../../public/lib/widgets/duration'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +import {DurationWidget} from '../../components/widgets/duration'; +import {Timestamp} from '../../components/widgets/timestamp'; import { LONG, LONG_NULL, diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_cause_link_utils.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_cause_link_utils.ts index a804ca9808..b0a517563f 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_cause_link_utils.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_cause_link_utils.ts @@ -16,7 +16,7 @@ import m from 'mithril'; import {Icons} from '../../base/semantic_icons'; import {duration, Time, time} from '../../base/time'; import {exists} from '../../base/utils'; -import {SliceSqlId} from '../../trace_processor/sql_utils/core_types'; +import {SliceSqlId} from '../../components/sql_utils/core_types'; import {Engine} from '../../trace_processor/engine'; import {LONG, NUM, STR} from '../../trace_processor/query_result'; import {Anchor} from '../../widgets/anchor'; diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_v3_details_panel.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_v3_details_panel.ts index 3265e4fe11..410e63562d 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_v3_details_panel.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_v3_details_panel.ts @@ -15,10 +15,10 @@ import m from 'mithril'; import {duration, Time, time} from '../../base/time'; import {exists} from '../../base/utils'; -import {getSlice, SliceDetails} from '../../trace_processor/sql_utils/slice'; -import {asSliceSqlId} from '../../trace_processor/sql_utils/core_types'; -import {DurationWidget} from '../../public/lib/widgets/duration'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; +import {getSlice, SliceDetails} from '../../components/sql_utils/slice'; +import {asSliceSqlId} from '../../components/sql_utils/core_types'; +import {DurationWidget} from '../../components/widgets/duration'; +import {Timestamp} from '../../components/widgets/timestamp'; import {Engine} from '../../trace_processor/engine'; import {LONG, NUM, STR} from '../../trace_processor/query_result'; import {DetailsShell} from '../../widgets/details_shell'; diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_v3_track.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_v3_track.ts index 4683dfaf52..99f29b25b7 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_v3_track.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_jank_v3_track.ts @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {NamedRow} from '../../frontend/named_slice_track'; +import {NamedRow} from '../../components/tracks/named_slice_track'; import {Slice} from '../../public/track'; import { CustomSqlTableDefConfig, CustomSqlTableSliceTrack, -} from '../../frontend/tracks/custom_sql_table_slice_track'; +} from '../../components/tracks/custom_sql_table_slice_track'; import {JANK_COLOR} from './jank_colors'; -import {getColorForSlice} from '../../public/lib/colorizer'; +import {getColorForSlice} from '../../components/colorizer'; import {TrackEventSelection} from '../../public/selection'; import {ScrollJankV3DetailsPanel} from './scroll_jank_v3_details_panel'; diff --git a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_track.ts b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_track.ts index 3721123438..aa071c7c35 100644 --- a/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_track.ts +++ b/ui/src/plugins/org.chromium.ChromeScrollJank/scroll_track.ts @@ -15,7 +15,7 @@ import { CustomSqlTableDefConfig, CustomSqlTableSliceTrack, -} from '../../frontend/tracks/custom_sql_table_slice_track'; +} from '../../components/tracks/custom_sql_table_slice_track'; import {TrackEventSelection} from '../../public/selection'; import {ScrollDetailsPanel} from './scroll_details_panel'; diff --git a/ui/src/plugins/org.chromium.ChromeTasks/details.ts b/ui/src/plugins/org.chromium.ChromeTasks/details.ts index ac96447b61..d035069ce2 100644 --- a/ui/src/plugins/org.chromium.ChromeTasks/details.ts +++ b/ui/src/plugins/org.chromium.ChromeTasks/details.ts @@ -16,7 +16,7 @@ import m from 'mithril'; import { Details, DetailsSchema, -} from '../../frontend/widgets/sql/details/details'; +} from '../../components/widgets/sql/details/details'; import {DetailsShell} from '../../widgets/details_shell'; import {GridLayout, GridLayoutColumn} from '../../widgets/grid_layout'; import {TrackEventDetailsPanel} from '../../public/details_panel'; diff --git a/ui/src/plugins/org.chromium.ChromeTasks/index.ts b/ui/src/plugins/org.chromium.ChromeTasks/index.ts index 6c0f426693..a5e5013b4f 100644 --- a/ui/src/plugins/org.chromium.ChromeTasks/index.ts +++ b/ui/src/plugins/org.chromium.ChromeTasks/index.ts @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {asUtid} from '../../trace_processor/sql_utils/core_types'; +import {asUtid} from '../../components/sql_utils/core_types'; import {NUM, NUM_NULL, STR_NULL} from '../../trace_processor/query_result'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; import {chromeTasksTable} from './table'; import {ChromeTasksThreadTrack} from './track'; import {TrackNode} from '../../public/workspace'; -import {extensions} from '../../public/lib/extensions'; +import {extensions} from '../../components/extensions'; export default class implements PerfettoPlugin { static readonly id = 'org.chromium.ChromeTasks'; diff --git a/ui/src/plugins/org.chromium.ChromeTasks/table.ts b/ui/src/plugins/org.chromium.ChromeTasks/table.ts index f0231e51dd..b21e8ae317 100644 --- a/ui/src/plugins/org.chromium.ChromeTasks/table.ts +++ b/ui/src/plugins/org.chromium.ChromeTasks/table.ts @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {SqlTableDescription} from '../../frontend/widgets/sql/table/table_description'; +import {SqlTableDescription} from '../../components/widgets/sql/table/table_description'; import { ArgSetColumnSet, DurationColumn, SliceIdColumn, StandardColumn, TimestampColumn, -} from '../../frontend/widgets/sql/table/well_known_columns'; +} from '../../components/widgets/sql/table/well_known_columns'; export const chromeTasksTable: SqlTableDescription = { imports: ['chrome.tasks'], diff --git a/ui/src/plugins/org.chromium.ChromeTasks/track.ts b/ui/src/plugins/org.chromium.ChromeTasks/track.ts index 030af9e47a..9042d92b12 100644 --- a/ui/src/plugins/org.chromium.ChromeTasks/track.ts +++ b/ui/src/plugins/org.chromium.ChromeTasks/track.ts @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import {Utid} from '../../trace_processor/sql_utils/core_types'; +import {Utid} from '../../components/sql_utils/core_types'; import { CustomSqlTableDefConfig, CustomSqlTableSliceTrack, -} from '../../frontend/tracks/custom_sql_table_slice_track'; +} from '../../components/tracks/custom_sql_table_slice_track'; import {Trace} from '../../public/trace'; import {TrackEventSelection} from '../../public/selection'; import {ChromeTasksDetailsPanel} from './details'; diff --git a/ui/src/plugins/org.kernel.SuspendResumeLatency/index.ts b/ui/src/plugins/org.kernel.SuspendResumeLatency/index.ts index 973af15172..386434c67b 100644 --- a/ui/src/plugins/org.kernel.SuspendResumeLatency/index.ts +++ b/ui/src/plugins/org.kernel.SuspendResumeLatency/index.ts @@ -20,7 +20,7 @@ import {TrackNode} from '../../public/workspace'; import {SLICE_TRACK_KIND} from '../../public/track_kinds'; import {SuspendResumeDetailsPanel} from './suspend_resume_details'; import {Slice} from '../../public/track'; -import {OnSliceClickArgs} from '../../frontend/base_slice_track'; +import {OnSliceClickArgs} from '../../components/tracks/base_slice_track'; import {ThreadMap} from '../dev.perfetto.Thread/threads'; import ThreadPlugin from '../dev.perfetto.Thread'; import AsyncSlicesPlugin from '../dev.perfetto.AsyncSlices'; diff --git a/ui/src/plugins/org.kernel.SuspendResumeLatency/suspend_resume_details.ts b/ui/src/plugins/org.kernel.SuspendResumeLatency/suspend_resume_details.ts index d43f6997d2..296f3b47a9 100644 --- a/ui/src/plugins/org.kernel.SuspendResumeLatency/suspend_resume_details.ts +++ b/ui/src/plugins/org.kernel.SuspendResumeLatency/suspend_resume_details.ts @@ -19,8 +19,8 @@ import {DetailsShell} from '../../widgets/details_shell'; import {GridLayout} from '../../widgets/grid_layout'; import {Section} from '../../widgets/section'; import {Tree, TreeNode} from '../../widgets/tree'; -import {Timestamp} from '../../public/lib/widgets/timestamp'; -import {DurationWidget} from '../../public/lib/widgets/duration'; +import {Timestamp} from '../../components/widgets/timestamp'; +import {DurationWidget} from '../../components/widgets/duration'; import {Anchor} from '../../widgets/anchor'; import {Engine} from '../../trace_processor/engine'; import {TrackEventDetailsPanel} from '../../public/details_panel'; diff --git a/ui/src/plugins/org.kernel.Wattson/index.ts b/ui/src/plugins/org.kernel.Wattson/index.ts index 825521dbc3..765b718436 100644 --- a/ui/src/plugins/org.kernel.Wattson/index.ts +++ b/ui/src/plugins/org.kernel.Wattson/index.ts @@ -15,7 +15,7 @@ import { BaseCounterTrack, CounterOptions, -} from '../../frontend/base_counter_track'; +} from '../../components/tracks/base_counter_track'; import {Trace} from '../../public/trace'; import {PerfettoPlugin} from '../../public/plugin'; import {CPUSS_ESTIMATE_TRACK_KIND} from '../../public/track_kinds'; diff --git a/ui/src/public/debug_tracks.ts b/ui/src/public/debug_tracks.ts deleted file mode 100644 index 15577e3e11..0000000000 --- a/ui/src/public/debug_tracks.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (C) 2024 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// TODO(primiano): in near future the code to create debug tracks from an App -// context will be moved here. For now i'm just re-exporting the function as-is. -export {addDebugSliceTrack} from './lib/tracks/debug_tracks'; diff --git a/ui/src/public/lib/tracks/slice_layout.ts b/ui/src/public/lib/tracks/slice_layout.ts deleted file mode 100644 index d328d1cc62..0000000000 --- a/ui/src/public/lib/tracks/slice_layout.ts +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) 2021 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -export interface SliceLayoutBase { - readonly padding: number; // vertical pixel padding between slices and track. - readonly rowSpacing: number; // Spacing between rows. - - // A *guess* at the depth - readonly depthGuess?: number; - - // True iff the track is flat (all slices have the same depth - // we have an optimisation for this). - readonly isFlat?: boolean; - - readonly titleSizePx?: number; - readonly subtitleSizePx?: number; -} - -export const SLICE_LAYOUT_BASE_DEFAULTS: SliceLayoutBase = Object.freeze({ - padding: 3, - rowSpacing: 0, -}); - -export interface SliceLayoutFixed extends SliceLayoutBase { - readonly heightMode: 'FIXED'; - readonly fixedHeight: number; // Outer height of the track. -} - -export const SLICE_LAYOUT_FIXED_DEFAULTS: SliceLayoutFixed = Object.freeze({ - ...SLICE_LAYOUT_BASE_DEFAULTS, - heightMode: 'FIXED', - fixedHeight: 30, -}); - -export interface SliceLayoutFitContent extends SliceLayoutBase { - readonly heightMode: 'FIT_CONTENT'; - readonly sliceHeight: number; // Only when heightMode = 'FIT_CONTENT'. -} - -export const SLICE_LAYOUT_FIT_CONTENT_DEFAULTS: SliceLayoutFitContent = - Object.freeze({ - ...SLICE_LAYOUT_BASE_DEFAULTS, - heightMode: 'FIT_CONTENT', - sliceHeight: 18, - }); - -export interface SliceLayoutFlat extends SliceLayoutBase { - readonly heightMode: 'FIXED'; - readonly fixedHeight: number; // Outer height of the track. - readonly depthGuess: 0; - readonly isFlat: true; -} - -export const SLICE_LAYOUT_FLAT_DEFAULTS: SliceLayoutFlat = Object.freeze({ - ...SLICE_LAYOUT_BASE_DEFAULTS, - depthGuess: 0, - isFlat: true, - heightMode: 'FIXED', - fixedHeight: 18, - titleSizePx: 10, - padding: 3, -}); - -export type SliceLayout = - | SliceLayoutFixed - | SliceLayoutFitContent - | SliceLayoutFlat; - -export const DEFAULT_SLICE_LAYOUT: SliceLayout = - SLICE_LAYOUT_FIT_CONTENT_DEFAULTS;