fix #1851 for Arch Linux users (#2214)

* fix #1851 for Arch Linux users
diff --git a/tools/bashreadline.py b/tools/bashreadline.py
index af4f18e..4cc1f96 100755
--- a/tools/bashreadline.py
+++ b/tools/bashreadline.py
@@ -3,7 +3,12 @@
 # bashreadline  Print entered bash commands from all running shells.
 #               For Linux, uses BCC, eBPF. Embedded C.
 #
+# USAGE: bashreadline [-s SHARED]
 # This works by tracing the readline() function using a uretprobe (uprobes).
+# When you failed to run the script directly with error:
+# `Exception: could not determine address of symbol b'readline'`,
+# you may need specify the location of libreadline.so library
+# with `-s` option.
 #
 # Copyright 2016 Netflix, Inc.
 # Licensed under the Apache License, Version 2.0 (the "License")
@@ -14,6 +19,18 @@
 from __future__ import print_function
 from bcc import BPF
 from time import strftime
+import argparse
+
+parser = argparse.ArgumentParser(
+        description="Print entered bash commands from all running shells",
+        formatter_class=argparse.RawDescriptionHelpFormatter)
+parser.add_argument("-s", "--shared", nargs="?",
+        const="/lib/libreadline.so", type=str,
+        help="specify the location of libreadline.so library.\
+              Default is /lib/libreadline.so")
+args = parser.parse_args()
+
+name = args.shared if args.shared else "/bin/bash"
 
 # load BPF program
 bpf_text = """
@@ -41,7 +58,7 @@
 """
 
 b = BPF(text=bpf_text)
-b.attach_uretprobe(name="/bin/bash", sym="readline", fn_name="printret")
+b.attach_uretprobe(name=name, sym="readline", fn_name="printret")
 
 # header
 print("%-9s %-6s %s" % ("TIME", "PID", "COMMAND"))