def setup_regular_profiler(service_name: str) -> None:
    """
    Set up regular Python cProf profiler and write result to a file on exit.
    """
    profiler = cProfile.Profile()
    profiler.enable()

    file_path = os.path.join(
        "/tmp", "%s-%s-%s.cprof" % (service_name, platform.machine(), int(time.time()))
    )

    print("Eventlet profiler enabled")
    print("Profiling data will be saved to %s on exit" % (file_path))

    def stop_profiler():
        profiler.disable()
        profiler.dump_stats(file_path)
        print("Profiling data written to %s" % (file_path))
        print("You can view it using: ")
        print("\t python3 -m pstats %s" % (file_path))

    atexit.register(stop_profiler)

    Set up regular Python cProf profiler and write result to a file on exit.
    
st2client/st2client/utils/profiler.py