systrace: plumb the -a flag through to systrace.py

Change-Id: I93d10fb3c526c3cbe6a19220b489bb327bb3146b
diff --git a/systrace.py b/systrace.py
index da98284..e5da99d 100755
--- a/systrace.py
+++ b/systrace.py
@@ -32,6 +32,9 @@
                     help='use a trace buffer size of N KB', metavar='N')
   parser.add_option('-l', '--list-categories', dest='list_categories', default=False,
                     action='store_true', help='list the available categories and exit')
+  parser.add_option('-a', '--app', dest='app_name', default=None, type='string',
+                    action='store', help='enable application-level tracing for comma-separated ' +
+                    'list of app cmdlines')
 
   parser.add_option('--link-assets', dest='link_assets', default=False,
                     action='store_true', help='link to original CSS or JS resources '
@@ -60,12 +63,16 @@
         atrace_args.extend(['-t', str(options.trace_time)])
       else:
         parser.error('the trace time must be a positive number')
+
     if options.trace_buf_size is not None:
       if options.trace_buf_size > 0:
         atrace_args.extend(['-b', str(options.trace_buf_size)])
       else:
         parser.error('the trace buffer size must be a positive number')
 
+    if options.app_name is not None:
+      atrace_args.extend(['-a', options.app_name])
+
     atrace_args.extend(args)
 
   if atrace_args[0] == 'adb':
@@ -200,6 +207,7 @@
 html_prefix = """<!DOCTYPE HTML>
 <html>
 <head i18n-values="dir:textdirection;">
+<meta charset="utf-8"/>
 <title>Android System Trace</title>
 %s
 %s