blob: cdc5fa02fd1fda85a449df02892a3dd8a8e085b9 [file] [log] [blame]
Mathias Agopian4ea13dc2013-05-06 20:20:50 -07001/*
2 * Copyright (C) 2005 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
Martijn Coenenf75a23d2016-08-01 11:55:17 +020017#ifndef ANDROID_HARDWARE_BINDER_DEBUG_H
18#define ANDROID_HARDWARE_BINDER_DEBUG_H
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070019
20#include <stdint.h>
Colin Crossdd6dafb2017-06-22 12:29:13 -070021#include <sys/cdefs.h>
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070022#include <sys/types.h>
23
Steven Morelandb5f6e002021-02-26 01:51:20 +000024// WARNING: this code is part of libhwbinder, a fork of libbinder. Generally,
25// this means that it is only relevant to HIDL. Any AIDL- or libbinder-specific
26// code should not try to use these things.
27
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070028namespace android {
Martijn Coenenf75a23d2016-08-01 11:55:17 +020029namespace hardware {
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070030// ---------------------------------------------------------------------------
31
Colin Crossdd6dafb2017-06-22 12:29:13 -070032__BEGIN_DECLS
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070033
34const char* stringForIndent(int32_t indentLevel);
35
36typedef void (*debugPrintFunc)(void* cookie, const char* txt);
37
38void printTypeCode(uint32_t typeCode,
Yi Kong55d41072018-07-23 14:55:39 -070039 debugPrintFunc func = nullptr, void* cookie = nullptr);
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070040
41void printHexData(int32_t indent, const void *buf, size_t length,
42 size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16,
43 size_t alignment=0, bool cArrayStyle=false,
Yi Kong55d41072018-07-23 14:55:39 -070044 debugPrintFunc func = nullptr, void* cookie = nullptr);
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070045
Colin Crossdd6dafb2017-06-22 12:29:13 -070046ssize_t getHWBinderKernelReferences(size_t count, uintptr_t* buf);
47
48__END_DECLS
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070049
50// ---------------------------------------------------------------------------
Steven Moreland7173a4c2019-09-26 15:55:02 -070051} // namespace hardware
52} // namespace android
Mathias Agopian4ea13dc2013-05-06 20:20:50 -070053
Martijn Coenenf75a23d2016-08-01 11:55:17 +020054#endif // ANDROID_HARDWARE_BINDER_DEBUG_H