• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2024 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15import m from 'mithril';
16
17import {Probe, ProbeAttrs} from '../record_widgets';
18
19import {RecordingSectionAttrs} from './recording_sections';
20
21export class EtwSettings implements m.ClassComponent<RecordingSectionAttrs> {
22  view({attrs}: m.CVnode<RecordingSectionAttrs>) {
23    return m(
24      `.record-section${attrs.cssClass}`,
25      m(Probe, {
26        title: 'CSwitch',
27        img: null,
28        descr: `Enables to recording of context switches.`,
29        setEnabled: (cfg, val) => (cfg.etwCSwitch = val),
30        isEnabled: (cfg) => cfg.etwCSwitch,
31      } as ProbeAttrs),
32      m(Probe, {
33        title: 'Dispatcher',
34        img: null,
35        descr: 'Enables to get thread state.',
36        setEnabled: (cfg, val) => (cfg.etwThreadState = val),
37        isEnabled: (cfg) => cfg.etwThreadState,
38      } as ProbeAttrs),
39    );
40  }
41}
42