Show build config in dumpsys SurfaceFlinger
This adds a line to the "dumpsys SurfaceFlinger" output that shows build-time configuration values. Example: Build configuration: [sf HAS_CONTEXT_PRIORITY] [libui] \ [libgui USE_FENCE_SYNC] Bug 7206633 Change-Id: Ibe1856b459d34a4be6ee83a4ebfd2807e6cc68a0
This commit is contained in:
parent
a046dd9772
commit
4803b74e2a
29
include/gui/GuiConfig.h
Normal file
29
include/gui/GuiConfig.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_GUI_CONFIG_H
|
||||
#define ANDROID_GUI_CONFIG_H
|
||||
|
||||
#include <utils/String8.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
// Append the libgui configuration details to configStr.
|
||||
void appendGuiConfigString(String8& configStr);
|
||||
|
||||
}; // namespace android
|
||||
|
||||
#endif /*ANDROID_GUI_CONFIG_H*/
|
29
include/ui/UiConfig.h
Normal file
29
include/ui/UiConfig.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_UI_CONFIG_H
|
||||
#define ANDROID_UI_CONFIG_H
|
||||
|
||||
#include <utils/String8.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
// Append the libui configuration details to configStr.
|
||||
void appendUiConfigString(String8& configStr);
|
||||
|
||||
}; // namespace android
|
||||
|
||||
#endif /*ANDROID_UI_CONFIG_H*/
|
@ -24,7 +24,8 @@ LOCAL_SRC_FILES:= \
|
||||
SurfaceComposerClient.cpp \
|
||||
DummyConsumer.cpp \
|
||||
CpuConsumer.cpp \
|
||||
BufferItemConsumer.cpp
|
||||
BufferItemConsumer.cpp \
|
||||
GuiConfig.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libbinder \
|
||||
|
38
libs/gui/GuiConfig.cpp
Normal file
38
libs/gui/GuiConfig.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#include <gui/GuiConfig.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
void appendGuiConfigString(String8& configStr)
|
||||
{
|
||||
static const char* config =
|
||||
" [libgui"
|
||||
#ifdef USE_FENCE_SYNC
|
||||
" USE_FENCE_SYNC"
|
||||
#endif
|
||||
#ifdef USE_NATIVE_FENCE_SYNC
|
||||
" USE_NATIVE_FENCE_SYNC"
|
||||
#endif
|
||||
#ifdef ALLOW_DEQUEUE_CURRENT_BUFFER
|
||||
" ALLOW_DEQUEUE_CURRENT_BUFFER"
|
||||
#endif
|
||||
"]";
|
||||
configStr.append(config);
|
||||
}
|
||||
|
||||
}; // namespace android
|
@ -23,7 +23,8 @@ LOCAL_SRC_FILES:= \
|
||||
GraphicBufferMapper.cpp \
|
||||
PixelFormat.cpp \
|
||||
Rect.cpp \
|
||||
Region.cpp
|
||||
Region.cpp \
|
||||
UiConfig.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils \
|
||||
|
36
libs/ui/UiConfig.cpp
Normal file
36
libs/ui/UiConfig.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#include <ui/UiConfig.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
#define TOSTRING(x) STRINGIFY(x)
|
||||
|
||||
void appendUiConfigString(String8& configStr)
|
||||
{
|
||||
static const char* config =
|
||||
" [libui"
|
||||
#ifdef FRAMEBUFFER_FORCE_FORMAT
|
||||
" FRAMEBUFFER_FORCE_FORMAT=" TOSTRING(FRAMEBUFFER_FORCE_FORMAT)
|
||||
#endif
|
||||
"]";
|
||||
configStr.append(config);
|
||||
}
|
||||
|
||||
|
||||
}; // namespace android
|
@ -37,11 +37,13 @@
|
||||
|
||||
#include <gui/BitTube.h>
|
||||
#include <gui/BufferQueue.h>
|
||||
#include <gui/GuiConfig.h>
|
||||
#include <gui/IDisplayEventConnection.h>
|
||||
#include <gui/SurfaceTextureClient.h>
|
||||
|
||||
#include <ui/GraphicBufferAllocator.h>
|
||||
#include <ui/PixelFormat.h>
|
||||
#include <ui/UiConfig.h>
|
||||
|
||||
#include <utils/misc.h>
|
||||
#include <utils/String8.h>
|
||||
@ -2045,6 +2047,26 @@ void SurfaceFlinger::clearStatsLocked(const Vector<String16>& args, size_t& inde
|
||||
}
|
||||
}
|
||||
|
||||
/*static*/ void SurfaceFlinger::appendSfConfigString(String8& result)
|
||||
{
|
||||
static const char* config =
|
||||
" [sf"
|
||||
#ifdef NO_RGBX_8888
|
||||
" NO_RGBX_8888"
|
||||
#endif
|
||||
#ifdef HAS_CONTEXT_PRIORITY
|
||||
" HAS_CONTEXT_PRIORITY"
|
||||
#endif
|
||||
#ifdef NEVER_DEFAULT_TO_ASYNC_MODE
|
||||
" NEVER_DEFAULT_TO_ASYNC_MODE"
|
||||
#endif
|
||||
#ifdef TARGET_DISABLE_TRIPLE_BUFFERING
|
||||
" TARGET_DISABLE_TRIPLE_BUFFERING"
|
||||
#endif
|
||||
"]";
|
||||
result.append(config);
|
||||
}
|
||||
|
||||
void SurfaceFlinger::dumpAllLocked(
|
||||
String8& result, char* buffer, size_t SIZE) const
|
||||
{
|
||||
@ -2055,6 +2077,15 @@ void SurfaceFlinger::dumpAllLocked(
|
||||
nsecs_t inSwapBuffersDuration = (inSwapBuffers) ? now-inSwapBuffers : 0;
|
||||
nsecs_t inTransactionDuration = (inTransaction) ? now-inTransaction : 0;
|
||||
|
||||
/*
|
||||
* Dump library configuration.
|
||||
*/
|
||||
result.append("Build configuration:");
|
||||
appendSfConfigString(result);
|
||||
appendUiConfigString(result);
|
||||
appendGuiConfigString(result);
|
||||
result.append("\n");
|
||||
|
||||
/*
|
||||
* Dump the visible layer list
|
||||
*/
|
||||
|
@ -382,6 +382,7 @@ private:
|
||||
String8& result, char* buffer, size_t SIZE) const;
|
||||
void dumpAllLocked(String8& result, char* buffer, size_t SIZE) const;
|
||||
bool startDdmConnection();
|
||||
static void appendSfConfigString(String8& result);
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
* Attributes
|
||||
|
Loading…
Reference in New Issue
Block a user