Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
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
CodeLinaro
public-release-test-restored
platform
vendor
qcom-opensource
tools
Commits
c4876cf6
Commit
c4876cf6
authored
9 years ago
by
Linux Build Service Account
Committed by
Gerrit - the friendly Code Review server
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "ipc_logging: Update "test" command to accept version, add --64-bit option"
parents
cdaaa0e2
d596e39a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ipc_logging/ipc_logging.py
+52
-9
52 additions, 9 deletions
ipc_logging/ipc_logging.py
with
52 additions
and
9 deletions
ipc_logging/ipc_logging.py
+
52
−
9
View file @
c4876cf6
...
@@ -126,12 +126,18 @@ TSV_TYPE_MSG_END = 2
...
@@ -126,12 +126,18 @@ TSV_TYPE_MSG_END = 2
# unsigned char type;
# unsigned char type;
# unsigned char size; /* size of data field */
# unsigned char size; /* size of data field */
#};
#};
PAGE_HEADER_SIZE
=
4
*
4
+
2
*
2
+
2
*
4
V0_PAGE_HDR_SIZE
=
4
*
4
+
2
*
2
+
2
*
4
DEFAULT_CTX_HEADER_SIZE
=
0x40
V1_PAGE_HDR_SIZE
=
0x40
V1_PAGE_HDR_SIZE_64
=
0x48
PAGE_SIZE
=
4
*
1024
PAGE_SIZE
=
4
*
1024
FULL_PAGE_WRITE_OFFSET
=
0xFFFF
FULL_PAGE_WRITE_OFFSET
=
0xFFFF
CTX_READ_SIZE
=
64
CTX_READ_SIZE
=
64
# Default header sizes by IPC Logging Version
# V0 was 32-bit only, so it is used in the 64-bit list as a placeholder
PAGE_HDR_SIZES
=
[
V0_PAGE_HDR_SIZE
,
V1_PAGE_HDR_SIZE
]
PAGE_HDR_SIZES_64
=
[
V0_PAGE_HDR_SIZE
,
V1_PAGE_HDR_SIZE_64
]
class
LogTSV
(
object
):
class
LogTSV
(
object
):
"""
Handles processing message/value headers
"""
"""
Handles processing message/value headers
"""
...
@@ -426,7 +432,7 @@ class LogPage(object):
...
@@ -426,7 +432,7 @@ class LogPage(object):
self
.
nextPage
=
None
self
.
nextPage
=
None
self
.
nextData
=
None
self
.
nextData
=
None
self
.
iterated
=
False
self
.
iterated
=
False
self
.
page_header_size
=
PAGE_H
EADE
R_SIZE
self
.
page_header_size
=
V0_
PAGE_H
D
R_SIZE
self
.
unknown_messages_data
=
None
self
.
unknown_messages_data
=
None
def
pack_continue
(
self
,
strPayload
):
def
pack_continue
(
self
,
strPayload
):
...
@@ -812,7 +818,7 @@ class LogPage_v1(LogPage):
...
@@ -812,7 +818,7 @@ class LogPage_v1(LogPage):
self
.
headerBinaryFormat
=
'
<IIIHHQQQq
'
self
.
headerBinaryFormat
=
'
<IIIHHQQQq
'
self
.
headerBinaryFormatSize
=
struct
.
calcsize
(
self
.
headerBinaryFormat
)
self
.
headerBinaryFormatSize
=
struct
.
calcsize
(
self
.
headerBinaryFormat
)
self
.
context
=
LogContext
()
self
.
context
=
LogContext
()
self
.
context
.
header_size
=
DEFAULT_CTX_HEADE
R_SIZE
self
.
context
.
header_size
=
V1_PAGE_HD
R_SIZE
self
.
page_header_size
=
self
.
context
.
header_size
self
.
page_header_size
=
self
.
context
.
header_size
def
sortAndLink
(
self
,
lstPages
,
bSort
):
def
sortAndLink
(
self
,
lstPages
,
bSort
):
...
@@ -1552,6 +1558,14 @@ def cmdTest(options):
...
@@ -1552,6 +1558,14 @@ def cmdTest(options):
# load existing files
# load existing files
lstFiles
=
options
.
args
lstFiles
=
options
.
args
try
:
version
=
int
(
lstFiles
.
pop
())
except
ValueError
as
e
:
strMsg
=
"
Version must be provided! Exiting...
"
logging
.
error
(
"
Exception: %s
\n
%s
\n
"
%
(
str
(
e
),
strMsg
))
raise
for
f
in
lstFiles
:
for
f
in
lstFiles
:
data
=
open
(
f
,
'
rb
'
).
read
()
data
=
open
(
f
,
'
rb
'
).
read
()
...
@@ -1561,11 +1575,9 @@ def cmdTest(options):
...
@@ -1561,11 +1575,9 @@ def cmdTest(options):
if
page
.
isVersionOneOrGreater
(
data
):
if
page
.
isVersionOneOrGreater
(
data
):
page
=
LogPage_v1
()
page
=
LogPage_v1
()
page
.
unpack
(
data
)
page
.
unpack
(
data
)
version
=
1
else
:
else
:
page
=
LogPage_v0
()
page
=
LogPage_v0
()
page
.
unpack
(
data
)
page
.
unpack
(
data
)
version
=
0
numPages
+=
1
numPages
+=
1
dictPages
[
page
.
page_num
]
=
page
dictPages
[
page
.
page_num
]
=
page
...
@@ -1573,6 +1585,16 @@ def cmdTest(options):
...
@@ -1573,6 +1585,16 @@ def cmdTest(options):
(
f
,
page
.
log_id
,
page
.
page_num
))
(
f
,
page
.
log_id
,
page
.
page_num
))
page
.
log_info
()
page
.
log_info
()
try
:
if
options
.
arch_64
:
page
.
page_header_size
=
PAGE_HDR_SIZES_64
[
version
]
else
:
page
.
page_header_size
=
PAGE_HDR_SIZES
[
version
]
except
IndexError
as
e
:
strMsg
=
"
Invalid version! Exiting...
"
logging
.
error
(
"
Exception: %s
\n
%s
\n
"
%
(
str
(
e
),
strMsg
))
raise
# Use only the last pathname component, as the rest of the path is
# Use only the last pathname component, as the rest of the path is
# added in dumpLogWithRetry()
# added in dumpLogWithRetry()
if
options
.
output_dir
:
if
options
.
output_dir
:
...
@@ -1633,14 +1655,24 @@ hexadecimal.
...
@@ -1633,14 +1655,24 @@ hexadecimal.
test
test
----
----
%prog test LOG_PAGE_FILE(s)
%prog test
[--64-bit]
LOG_PAGE_FILE(s)
VERSION
Parses the provided log pages files in order and extracts the logs. This is
Parses the provided log pages files in order and extracts the logs. This is
useful for testing and for dealing with failure cases (such as duplicate logs
useful for testing and for dealing with failure cases (such as duplicate logs
due to left-over log pages from previous boot cycles).
due to left-over log pages from previous boot cycles).
Example:
The test command must be provided with the IPC Logging version in order to
\t
%prog test log-1-0.bin log-1-1.bin log-1-2.bin
determine the right log page header size to use when parsing. During normal
parsing, this information is gained from the log context, which is not provided
to the test command.
The --64-bit option denotes whether or not to interpret the provided log pages
as 64-bit dumps. This is also necessary to determine the log page header size.
Examples:
\t
%prog test log-1-0.bin log-1-1.bin log-1-2.bin 0
\t
%prog test --64-bit log-1-0.bin log-1-1.bin log-1-2.bin 1
\t
%prog test log-1-0.bin log-1-1.bin log-1-2.bin 1
===================================================
===================================================
General Options
General Options
...
@@ -1670,6 +1702,12 @@ output directory. The ipc_logging script will create the directory if it
...
@@ -1670,6 +1702,12 @@ output directory. The ipc_logging script will create the directory if it
doesn
'
t exist. All output will go to that directory. The script
'
s own logging
doesn
'
t exist. All output will go to that directory. The script
'
s own logging
will go to stdout as well as a file in the specified directory.
will go to stdout as well as a file in the specified directory.
64-bit
------
This option is only to be used with the test command. It is a no-op otherwise.
If used with the test command, the test command will interpret the log pages
given to it as 64-bit dumps.
Examples:
Examples:
\t
%prog parse -o ~/test_output DDRCS0.BIN DDRCS1.BIN
\t
%prog parse -o ~/test_output DDRCS0.BIN DDRCS1.BIN
\t
%prog test -v -o ~/test_output LOG_PAGE_FILE(s)
\t
%prog test -v -o ~/test_output LOG_PAGE_FILE(s)
...
@@ -1696,6 +1734,11 @@ Examples:
...
@@ -1696,6 +1734,11 @@ Examples:
a path for an output directory. The path is
\
a path for an output directory. The path is
\
OS-independent, and can be absolute or relative.
"
)
OS-independent, and can be absolute or relative.
"
)
parser
.
add_option
(
""
,
"
--64-bit
"
,
action
=
"
store_true
"
,
dest
=
"
arch_64
"
,
help
=
"
For use with the test command. Interpret the log pages as
\
64-bit dumps.
"
)
(
options
,
args
)
=
parser
.
parse_args
(
sys
.
argv
[
2
:])
(
options
,
args
)
=
parser
.
parse_args
(
sys
.
argv
[
2
:])
options
.
cmd
=
strCmd
options
.
cmd
=
strCmd
...
...
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