Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TraceGlobal {
nativeInit(Looper.getMainLooper().getThread());
JNIHook.init();
success = true;
} catch (Exception e) {
} catch (Throwable e) {
Log.e(TAG, "rhea-trace init failed: ", e);
success = false;
}
Expand All @@ -51,4 +51,4 @@ public static void capture(boolean force) {
}

private static native void nativeCapture(boolean force);
}
}
2 changes: 1 addition & 1 deletion btrace-iOS/BTraceTool/btrace/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def stop_record() -> Optional[bytes]:
url = util.API_HOST + "/record/stop"

config = {}
resp = requests.post(url, json=config, timeout=30)
resp = requests.post(url, json=config, timeout=60)
resp.raise_for_status()

gz_data = resp.content
Expand Down
19 changes: 16 additions & 3 deletions btrace-iOS/BTraceTool/btrace/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,20 @@ def cmd_record(args):

device_id = args.device_id
bundle_id = args.bundle_id
frequency = args.frequency
time_limit = args.time_limit or 3600
hitch = args.hitch or 50
hitch = max(hitch, 33)
main_thread_only = args.main_thread_only
launch = args.launch
next_launch = args.next_launch
verbose = args.verbose
upload = args.upload

util.set_verbose(verbose)

if util.verbose():
print("args: ", args)

device_info = {}

Expand Down Expand Up @@ -164,7 +169,7 @@ def cmd_record(args):
pid = device.connect_if_need(device_id)
pid_list.append(pid)

util.set_record_parameter(main_thread_only, hitch)
util.set_record_parameter(main_thread_only, hitch, frequency)

if launch:
app.launch(device_id, bundle_id)
Expand All @@ -188,7 +193,7 @@ def signal_stop(signum, frame):

signal.signal(signal.SIGINT, signal_stop)

print(f"Press cltr+c to stop")
print(f"Press ctrl+c to stop")

interval = 0.5
record_time = 0
Expand Down Expand Up @@ -218,10 +223,11 @@ def cmd_parse(args):
sys_symbol = args.sys_symbol
force = args.force
verbose = args.verbose
upload = args.upload

util.set_verbose(verbose)

parse(file_path, dsym_path, force, sys_symbol)
parse(file_path, dsym_path, force, sys_symbol, upload)


def cmd_export(args):
Expand Down Expand Up @@ -274,6 +280,7 @@ def main():
"-H", "--hitch", dest="hitch", type=int, help="hitch thres"
)
record_parser.add_argument("-d", "--dsym_path", dest="dsym_path", help="dsym dir")
record_parser.add_argument("-f", "--frequency", dest="frequency", help="frequency, e.g., 1ms, 100us")
record_parser.add_argument(
"-m",
"--main_thread_only",
Expand All @@ -293,6 +300,9 @@ def main():
record_parser.add_argument(
"-v", "--verbose", dest="verbose", action="store_true", help="show verbose info"
)
record_parser.add_argument(
"-u", "--upload", dest="upload", action="store_true", help="upload trace file"
)

# parse
parser_lib = subparser.add_parser("parse", help="parse trace data")
Expand All @@ -307,6 +317,9 @@ def main():
parser_lib.add_argument(
"-v", "--verbose", dest="verbose", action="store_true", help="show verbose info"
)
parser_lib.add_argument(
"-u", "--upload", dest="upload", action="store_true", help="upload trace file"
)

# export
export_lib = subparser.add_parser("export", help="export trace data")
Expand Down
Loading