#!/usr/bin/perl # Copyright (C) 2018 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.
use strict;
use Getopt::Long;
use Pod::Usage;
=pod
=head1 DESCRIPTION
This script parses API violations from C<adb logcat>. Output is in CSV format
with columns C<package>, C<symbol>, C<list>.
The package name is mapped from a PID, parsed from the same log. To ensure you
get all packages names, you should process the logcat from device boot time.
if ($bugreport) {
my $found_main = 0; while (my $line = <>) {
chomp $line; if ($line =~ m/^------ SYSTEM LOG /) {
$found_main = 1;
last;
}
} if (!$found_main) {
die "Couldn't find main log in bugreport\n";
}
}
my $procmap = {};
print "package,symbol,list\n" unless $short; while (my $line = <>) {
chomp $line;
last if $bugreport and $line =~ m/^------ \d+\.\d+s was the duration of 'SYSTEM LOG' ------/;
next if $line =~ m/^--------- beginning of/;
unless ($line =~ m/^\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}\s+(?:\w+\s+)?(\d+)\s+(\d+)\s+([VWIDE])\s+(.*?): (.*)$/) {
die "Cannot match line: $line\n";
next;
}
my ($pid, $tid, $class, $tag, $msg) = ($1, $2, $3, $4, $5); if ($tag eq "ActivityManager" && $msg =~ m/^Start proc (\d+):(.*?) for /) {
my ($new_pid, $proc_name) = ($1, $2);
my $package; if ($proc_name =~ m/^(.*?)(:.*?)?\/(.*)$/) {
$package = $1;
} else {
$package = $proc_name;
}
$procmap->{$new_pid} = $package;
} if ($msg =~ m/Accessing hidden (\w+) (L.*?) \((.*list), (.*?)\)/) {
my ($member_type, $symbol, $list, $access_type) = ($1, $2, $3, $4);
my $package = $procmap->{$pid} || "unknown($pid)"; if (($list =~ m/unsupported/ && $unsupported)
|| ($list =~ m/max-target/ && $maxtarget)
|| ($list =~ m/blocked/ && $blocked)) { if ($short) {
print "$symbol\n";
} else {
print "$package,$symbol,$list\n"
}
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.