• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2023 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 #include <dump/pixel_dump.h>
17 //#include <android-base/properties.h>
18 #include <android-base/file.h>
19 
20 #define BCMBT_SNOOP_LOG_DIRECTORY "/data/vendor/bluetooth"
21 #define BCMBT_FW_LOG_DIRECTORY "/data/vendor/ssrdump/coredump"
22 #define BCMBT_SNOOP_LOG_PREFIX "btsnoop_hci_vnd"
23 #define BCMBT_FW_DUMP_LOG_PREFIX "coredump_bt_socdump_"
24 #define BCMBT_CHRE_DUMP_LOG_PREFIX "coredump_bt_chredump_"
25 
main()26 int main() {
27     std::string outputDir = concatenatePath(BUGREPORT_PACKING_DIR, "bcmbt");
28     if (mkdir(outputDir.c_str(), 0777) == -1) {
29         printf("Unable to create folder: %s\n", outputDir.c_str());
30         return 0;
31     }
32 
33     dumpLogs(BCMBT_SNOOP_LOG_DIRECTORY, outputDir.c_str(), 2, BCMBT_SNOOP_LOG_PREFIX);
34     dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_FW_DUMP_LOG_PREFIX);
35     dumpLogs(BCMBT_FW_LOG_DIRECTORY, outputDir.c_str(), 10, BCMBT_CHRE_DUMP_LOG_PREFIX);
36     return 0;
37 }
38