Remove unassigned event log tags feature
.logtags files are a mapping of an integer -> name. However, there
is an unused feature where you could put a '?' instead of an integer,
and then the build system would assign a number to it, taking care
to avoid all other already-assigned numbers across the source tree.
This feature makes it hard to support some things we're working towards,
like incremental soong and treble common system images, so remove it.
Also modernize the python scripts a little.
Bug: 382515940
Test: m event-log-tags
Change-Id: Iae49e9924ac70f1ed0c141e21bc21c5d1974ef84
diff --git a/android/logtags.go b/android/logtags.go
index 7929057..1e92dad 100644
--- a/android/logtags.go
+++ b/android/logtags.go
@@ -16,41 +16,8 @@
import "github.com/google/blueprint"
-func init() {
- RegisterParallelSingletonType("logtags", LogtagsSingleton)
-}
-
type LogtagsInfo struct {
Logtags Paths
}
var LogtagsProviderKey = blueprint.NewProvider[*LogtagsInfo]()
-
-func LogtagsSingleton() Singleton {
- return &logtagsSingleton{}
-}
-
-type logtagsSingleton struct{}
-
-func MergedLogtagsPath(ctx PathContext) OutputPath {
- return PathForIntermediates(ctx, "all-event-log-tags.txt")
-}
-
-func (l *logtagsSingleton) GenerateBuildActions(ctx SingletonContext) {
- var allLogtags Paths
- ctx.VisitAllModules(func(module Module) {
- if !module.ExportedToMake() {
- return
- }
- if logtagsInfo, ok := OtherModuleProvider(ctx, module, LogtagsProviderKey); ok {
- allLogtags = append(allLogtags, logtagsInfo.Logtags...)
- }
- })
-
- builder := NewRuleBuilder(pctx, ctx)
- builder.Command().
- BuiltTool("merge-event-log-tags").
- FlagWithOutput("-o ", MergedLogtagsPath(ctx)).
- Inputs(SortedUniquePaths(allLogtags))
- builder.Build("all-event-log-tags.txt", "merge logtags")
-}
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index b9cb076..cd3808c 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -878,8 +878,7 @@
eventLogtagsPath := etcPath.Join(ctx, "event-log-tags")
builder.Command().Text("mkdir").Flag("-p").Text(etcPath.String())
cmd := builder.Command().BuiltTool("merge-event-log-tags").
- FlagWithArg("-o ", eventLogtagsPath.String()).
- FlagWithInput("-m ", android.MergedLogtagsPath(ctx))
+ FlagWithArg("-o ", eventLogtagsPath.String())
for _, path := range android.SortedKeys(logtagsFilePaths) {
cmd.Text(path)