• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.internal.protolog;
18 
19 import com.android.internal.protolog.IProtoLogClient;
20 
21 /**
22  * The ProtoLog Service interface.
23  *
24  * This service runs in system server.
25  *
26  * All ProtoLog clients (in theory one per process) will register themselves to this service.
27  * This service will then serve as the entry point for any shell command based interactions with
28  * protolog and get/forward any required information/actions from/to all the registered ProtoLog
29  * clients.
30  *
31  * Clients will be responsible for directly sending all their trace data to Perfetto without passing
32  * through this service, except viewer config data, the mappings from messages hashes (generated by
33  * the ProtoLog Tool if and when the tool processed the source code). So, this service is
34  * responsible for dumping the viewer config data from all clients. The reason for this is because
35  * we do this on Perfetto's onFlush callback when a tracing instance is stopped. However, if a
36  * client process is frozen then this will not dump; system server, where this service runs cannot
37  * be frozen. Secondly many processes (i.e. apps) will run the same code with the same viewer config
38  * data, so this service allows us to orchestrate which config gets dumped so we don't duplicate
39  * this information in the trace and waste valuable trace space.
40  *
41  * {@hide}
42  */
43 interface IProtoLogConfigurationService {
44     parcelable RegisterClientArgs {
45         String[] groups;
46         boolean[] groupsDefaultLogcatStatus;
47         String viewerConfigFile;
48     }
49 
registerClient(IProtoLogClient client, in RegisterClientArgs args)50     oneway void registerClient(IProtoLogClient client, in RegisterClientArgs args);
51 }