I'm interested in debugging and profiling my artiq (kernel) code. There seem to be tools for that (artiq_coremgmt debug and artiq_coremgmt profile), but the documentation (https://m-labs.hk/artiq/manual/utilities.html#core-device-management-tool) of those seems a bit sparse, and I haven really been able to obtain much information by just running them as indicated in the documentation:

Running: artiq_coremgmt --device-db <path_to_device_db.py> debug allocator while operating the Sinara system in question doesn't output anything (on stdout or a file).

Running artiq_coremgmt --device-db <path_to_device_db.py> profile start and artiq_coremgmt --device-db <path_to_device_db.py> profile save profile.cgrnd <path_to_runtime.elf> exit both with an error:

Traceback (most recent call last):
  File "/nix/store/8qxmp5j7n5gybasrnfk17gvy0f6nfzd8-python3.7-artiq-5.7136.15bb0fa9/bin/.artiq_coremgmt-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/g5iwwg3cpxgim1vbl7p1l4ba41gjhd3a-python3-3.7.6-env/lib/python3.7/site-packages/artiq/frontend/artiq_coremgmt.py", line 188, in main
    mgmt.start_profiler(args.interval, args.hits_size, args.edges_size)
  File "/nix/store/g5iwwg3cpxgim1vbl7p1l4ba41gjhd3a-python3-3.7.6-env/lib/python3.7/site-packages/artiq/coredevice/comm_mgmt.py", line 192, in start_profiler
    self._read_expect(Reply.Success)
  File "/nix/store/g5iwwg3cpxgim1vbl7p1l4ba41gjhd3a-python3-3.7.6-env/lib/python3.7/site-packages/artiq/coredevice/comm_mgmt.py", line 117, in _read_expect
    format(self._read_type, ty))
AttributeError: 'CommMgmt' object has no attribute '_read_type'

artiq_coremgmt --device-db <path_to_device_db.py> profile stop returns nothing, which is expected, I guess.

Are there more resources on those utilities available somewhere? What's their intended use?

Thanks, and best regards!
Max

Im running Artiq 5 on both the host and the Sinara system. The host system runs Ubuntu, Artiq is installed via nix.

    max Running: artiq_coremgmt --device-db <path_to_device_db.py> debug allocator while operating the Sinara system in question doesn't output anything (on stdout or a file).

    Check the core device log.

    Running artiq_coremgmt --device-db <path_to_device_db.py> profile start and artiq_coremgmt --device-db <path_to_device_db.py> profile save profile.cgrnd <path_to_runtime.elf> exit both with an error:

    That's a bug and there may be other ones - these tools weren't finished and aren't maintained. The runtime contains a sampling profiler and IIRC it profiles the comms CPU only and not the kernel. After fixing the bug, you may be able to open the file with tools like kcachegrind.

    • max replied to this.

      sb10q Check the core device log.

      Nothing there as well.

      sb10q That's a bug and there may be other ones

      I'll have a look into it, as soon as I have time.

        Ah! Yes, that works. artiq_coremgmt --device-db <path_to_device_db.py> debug allocator prints memory allocation info on the UART.
        Thanks!