Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
20d9fdae
Commit
20d9fdae
authored
13 years ago
by
satok
Browse files
Options
Downloads
Patches
Plain Diff
Add a flag for a profiling
Change-Id: Iae509a24fd0f0f416376c3f8051aa2eb92d48659
parent
e0d3922b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
native/Android.mk
+7
-1
7 additions, 1 deletion
native/Android.mk
native/src/defines.h
+26
-22
26 additions, 22 deletions
native/src/defines.h
with
33 additions
and
23 deletions
native/Android.mk
+
7
−
1
View file @
20d9fdae
...
...
@@ -19,6 +19,7 @@ LOCAL_SRC_FILES := \
src/unigram_dictionary.cpp
#FLAG_DBG := true
#FLAG_DO_PROFILE := true
TARGETING_UNBUNDLED_FROYO
:=
true
...
...
@@ -39,10 +40,15 @@ LOCAL_MODULE := libjni_latinime
LOCAL_MODULE_TAGS
:=
user
ifeq
($(FLAG_DO_PROFILE), true)
$(
warning
Making profiling version of native library
)
LOCAL_CFLAGS
+=
-DFLAG_DO_PROFILE
else
# FLAG_DO_PROFILE
ifeq
($(FLAG_DBG), true)
$(
warning
Making debug version of native library
)
LOCAL_CFLAGS
+=
-DFLAG_DBG
LOCAL_SHARED_LIBRARIES
:=
libcutils libutils
endif
endif
# FLAG_DBG
endif
# FLAG_DO_PROFILE
include
$(BUILD_SHARED_LIBRARY)
This diff is collapsed.
Click to expand it.
native/src/defines.h
+
26
−
22
View file @
20d9fdae
...
...
@@ -18,18 +18,7 @@
#ifndef LATINIME_DEFINES_H
#define LATINIME_DEFINES_H
#ifdef FLAG_DBG
#include
<cutils/log.h>
#ifndef LOG_TAG
#define LOG_TAG "LatinIME: "
#endif
#define DEBUG_DICT true
#define DEBUG_DICT_FULL false
#define DEBUG_SHOW_FOUND_WORD DEBUG_DICT_FULL
#define DEBUG_NODE DEBUG_DICT_FULL
#define DEBUG_TRACE DEBUG_DICT_FULL
#define DEBUG_PROXIMITY_INFO true
#ifdef FLAG_DO_PROFILE
// Profiler
#include
<time.h>
#define PROF_BUF_SIZE 100
...
...
@@ -76,16 +65,7 @@ static void prof_out(void) {
}
}
#else // FLAG_DBG
#define LOGE(fmt, ...)
#define LOGI(fmt, ...)
#define DEBUG_DICT false
#define DEBUG_DICT_FULL false
#define DEBUG_SHOW_FOUND_WORD false
#define DEBUG_NODE false
#define DEBUG_TRACE false
#define DEBUG_PROXIMITY_INFO false
#else // FLAG_DO_PROFILE
#define PROF_BUF_SIZE 0
#define PROF_RESET
#define PROF_COUNT(prof_buf_id)
...
...
@@ -97,6 +77,30 @@ static void prof_out(void) {
#define PROF_CLOCKOUT(prof_buf_id)
#define PROF_OUTALL
#endif // FLAG_DO_PROFILE
#ifdef FLAG_DBG
#include
<cutils/log.h>
#ifndef LOG_TAG
#define LOG_TAG "LatinIME: "
#endif
#define DEBUG_DICT true
#define DEBUG_DICT_FULL false
#define DEBUG_SHOW_FOUND_WORD DEBUG_DICT_FULL
#define DEBUG_NODE DEBUG_DICT_FULL
#define DEBUG_TRACE DEBUG_DICT_FULL
#define DEBUG_PROXIMITY_INFO true
#else // FLAG_DBG
#define LOGE(fmt, ...)
#define LOGI(fmt, ...)
#define DEBUG_DICT false
#define DEBUG_DICT_FULL false
#define DEBUG_SHOW_FOUND_WORD false
#define DEBUG_NODE false
#define DEBUG_TRACE false
#define DEBUG_PROXIMITY_INFO false
#endif // FLAG_DBG
#ifndef U_SHORT_MAX
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment