Skip to content

Instantly share code, notes, and snippets.

@geeksville
Last active August 29, 2015 14:14
Show Gist options
  • Save geeksville/9ea505ba4fd2a6d3d3db to your computer and use it in GitHub Desktop.
Save geeksville/9ea505ba4fd2a6d3d3db to your computer and use it in GitHub Desktop.

Current profiling

for:

tools/mavlogdump.py ~/Downloads/arthur-3dr.tlog

Baseline:

name                                  ncall  tsub      ttot      tavg      
..vutil.py:301 mavlogfile.recv_match  26880  0.065494  2.816088  0.000105
..mavutil.py:281 mavlogfile.recv_msg  26880  0.189414  2.731705  0.000102
..lotmega.py:4776 MAVLink.parse_char  53758  0.311195  1.747652  0.000033 * some extra cost
..dupilotmega.py:4834 MAVLink.decode  26879  0.582442  1.289703  0.000048 * VERY EXPENSIVE - called from parse_char - most of the parse_char cost
..til.py:952 mavlogfile.post_message  26879  0.121017  0.395777  0.000015 * calls superclass and little else
..erator/mavcrc.py:6 x25crc.__init__  26879  0.053591  0.326831  0.000012
.. MAVLink_heartbeat_message.__str__  26879  0.240268  0.296173  0.000011 * IGNORE ME - only used because we are doing log printing
..til.py:209 mavlogfile.post_message  26879  0.215464  0.267857  0.000010 * called from recv_msg - slight expnsive
..tor/mavcrc.py:14 x25crc.accumulate  26879  0.252346  0.252346  0.000009
..util.py:924 mavlogfile.pre_message  26880  0.163922  0.246008  0.000009 * called from recv_msg - slight expensive - reads the 8 byte timestamp

Plan

approximate this in the C++ code

mavlink_map = {
    MAVLINK_MSG_ID_SENSOR_OFFSETS : ( '<fiiffffffhhh', MAVLink_sensor_offsets_message, [9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 134 ),
    MAVLINK_MSG_ID_SET_MAG_OFFSETS : ( '<hhhBB', MAVLink_set_mag_offsets_message, [3, 4, 0, 1, 2], [1, 1, 1, 1, 1], 219 ),
    MAVLINK_MSG_ID_MEMINFO : ( '<HH', MAVLink_meminfo_message, [0, 1], [1, 1], 208 ),

and for each msg (example):

class MAVLink_meminfo_message(MAVLink_message):
    '''
    state of APM memory
    '''
    def __init__(self, brkval, freemem):
            MAVLink_message.__init__(self, MAVLINK_MSG_ID_MEMINFO, 'MEMINFO')
            self._fieldnames = ['brkval', 'freemem']
            self.brkval = brkval
            self.freemem = freemem

    def pack(self, mav):
            return MAVLink_message.pack(self, mav, 208, struct.pack('<HH', self.brkval, self.freemem))

When creating objects there are three options

  • option1: preinit the dict superclass - this avoids having to do hashtable based lookup in my custom c++ code
  • option2: don't init anything, and then lazily do the creation in getattr for each attribute fetch (need smarter lookup but * less cycles)
  • option3: hybrid - preinit the 'standard' attributes (msgId), but on the first call of getattr to handle missing attributes just statically init the remainder. I bet this will work best, because most packets we don't ever look at the non std attrs

TODO: look at existing C++ code but probably do something different TODO: Probably inherit from MAVLink_Packet so that most of the behavior can stay in python.

To deserialize

  • Have the constructor iterate through the byte buf and create attributes by reading out, int, float, etc... (if doing preinit of the dict)
  • This is simpler

To serialize

  • Have default constructor just create the attributes, but not init them
  • let python user set attributes as needed.
  • Have custom pack() C++ method return the proper buffer representation

To reuse existing C generated code

Create a message decoding 'dict': static const mavlink_message_info_t message_info[256] = MAVLINK_MESSAGE_INFO;

Call mavlink_parse_char to build up a mavlink_r_message:

* #include // For fixed-width uint8_t type * * mavlink_message_t msg; * int chan = 0; * * * while(serial.bytesAvailable > 0) * { * uint8_t byte = serial.getNextByte(); * if (mavlink_parse_char(chan, byte, &msg)) * { * printf("Received message with ID %d, sequence: %d from component %d of system %d", msg.msgid, msg.seq, msg.compid, msg.sysid); * } * } *

Once we have a message, look it up in the array to find the the mavlink_message_info_t for that message, then based on the metadata, construct python attributes.

TODO soon

  • use faster buffer version for mavudp
  • add an island so the native code can be compared 1:1 to the python code it replaced
  • have mavudp delegate file descriptor work to the native code
  • support using both the native and the legacy version for parsing - simultaneously - then compare the resulting packets
  • Test performance (it better be good!)
  • Test on a large corpus (for correctness)
  • lazily expand fields
  • properly select dialect in native code (by using python to build the datastructure)
  • remove link module because it contains expensive logging

Future optimization

mavproxy serial results

Not native (base case)

kevinh@kevin-think:~/development/drone/MAVProxy$ mavproxy.py --master=/dev/ttyUSB0,921600 --profile --daemon --rtscts --streamrate=10
Logging to mav.tlog
Running script /home/kevinh/.mavinit.scr
-> set moddebug 2
-> module load droneapi.module.api
Traceback (most recent call last):
  File "/home/kevinh/development/drone/MAVProxy/MAVProxy/mavproxy.py", line 258, in load_module
    m = import_package(modpath)
  File "/home/kevinh/development/drone/MAVProxy/MAVProxy/mavproxy.py", line 388, in import_package
    mod = __import__(name)
ImportError: No module named mavproxy_droneapi.module.api

DroneAPI loaded
Loaded module droneapi.module.api
==

RTL> Mode RTL
APM: ArduPlane V3.2.1beta1 (5d8cec23)
APM: PX4: a55016a5 NuttX: 29c0c2d1
APM: PX4v2 00270030 31334705 39343031
Received 501 parameters
Received 5001 packets, exiting.

Clock type: CPU
Ordered by: totaltime, desc

name                                  ncall  tsub      ttot      tavg      
..hon2.7/threading.py:752 Thread.run  1      0.000014  4.704702  4.704702
..MAVProxy/mavproxy.py:668 main_loop  1      0.148322  4.704688  4.704688
..oxy/mavproxy.py:467 process_master  2230   0.106122  3.331476  0.001494
..tmega.py:4853 MAVLink.parse_buffer  2230   0.025888  2.904772  0.001303
..lotmega.py:4797 MAVLink.parse_char  7268   0.101678  2.884868  0.000397
...py:230 LinkModule.master_callback  5020   0.648876  1.828274  0.000364
..y:4816 MAVLink.__parse_char_legacy  7268   0.128932  0.928525  0.000128
..b/python2.7/Queue.py:150 Queue.get  723..  0.093533  0.911841  0.000126
..oxy/mavproxy.py:633 periodic_tasks  3623   0.310035  0.891220  0.000246
..dupilotmega.py:4866 MAVLink.decode  4982   0.310308  0.755680  0.000152
..7/threading.py:309 _Condition.wait  202..  0.049515  0.638879  0.000315
..mp_module.py:83 ParamModule.master  13853  0.034549  0.323765  0.000023
..b/python2.7/Queue.py:107 Queue.put  7239   0.085365  0.298929  0.000041
..oxy/mavproxy.py:186 MPState.master  13853  0.215463  0.289215  0.000021
..erator/mavcrc.py:6 x25crc.__init__  5038   0.031074  0.231349  0.000046
../python2.7/Queue.py:93 Queue.empty  13017  0.087733  0.227951  0.000018
..threading.py:373 _Condition.notify  14479  0.095959  0.224445  0.000016
..tor/mavcrc.py:14 x25crc.accumulate  5094   0.191064  0.191064  0.000038
..link/mavutil.py:723 mavserial.recv  2323   0.014487  0.190236  0.000082
..ial/serialposix.py:453 Serial.read  2323   0.069070  0.175750  0.000076
...py:228 ParamModule.mavlink_packet  4981   0.026377  0.167079  0.000034
..param.py:232 ParamModule.idle_task  3623   0.034717  0.156514  0.000043
..util.py:209 mavserial.post_message  10002  0.122832  0.152659  0.000015
..py:66 TerrainModule.mavlink_packet  4981   0.024035  0.137567  0.000028
..til.py:1055 periodic_event.trigger  26720  0.095814  0.116966  0.000004
..ings.py:104 MPSettings.__getattr__  73492  0.116649  0.116649  0.000002
..eading.py:300 _Condition._is_owned  16506  0.051255  0.105568  0.000006
..pi.py:396 APIModule.mavlink_packet  4981   0.048153  0.086538  0.000017
../mp_module.py:43 LinkModule.module  25361  0.053013  0.077772  0.000003
..y/mavproxy.py:595 set_stream_rates  3624   0.046451  0.068940  0.000019
..ython2.7/Queue.py:200 Queue._qsize  22282  0.045132  0.063920  0.000003
..py:92 BatteryModule.mavlink_packet  4981   0.027293  0.063914  0.000013
..proxy_wp.py:105 WPModule.idle_task  3623   0.026155  0.063715  0.000018
..MAVLink_heartbeat_message.get_type  86238  0.060589  0.060589  0.000001
..MAVLink_heartbeat_message.__init__  5029   0.035314  0.046238  0.000009
.._rally.py:45 RallyModule.idle_task  3623   0.016176  0.035683  0.000010
.._fence.py:50 FenceModule.idle_task  3623   0.013565  0.032660  0.000009
..xy_link.py:49 LinkModule.idle_task  3623   0.013176  0.030144  0.000008
..param.py:43 ParamState.fetch_check  3623   0.011797  0.028566  0.000008
..e.py:59 FenceModule.mavlink_packet  4981   0.021389  0.028209  0.000006
..le.py:36 LinkModule.mavlink_packet  49810  0.028185  0.028185  0.000001
../mp_module.py:51 LinkModule.status  31119  0.028002  0.028002  0.000001
..xy_link.py:173 LinkModule.get_usec  5009   0.023477  0.027273  0.000005
..log.py:25 LogModule.mavlink_packet  4981   0.018300  0.024982  0.000005
..oxy/mavproxy.py:180 MPState.module  25361  0.024758  0.024758  0.000001
../python2.7/Queue.py:204 Queue._put  7239   0.019392  0.024693  0.000003
..py:297 _Condition._acquire_restore  2027   0.007323  0.023292  0.000011
..3 ParamState.handle_mavlink_packet  4981   0.016644  0.022854  0.000005
..vproxy_rc.py:21 RCModule.idle_task  3623   0.009156  0.021508  0.000006
../python2.7/Queue.py:208 Queue._get  7239   0.014906  0.019359  0.000003
..module.py:26 RelayModule.idle_task  32607  0.018928  0.018928  0.000001
..mega.py:41 MAVLink_header.__init__  10066  0.018874  0.018874  0.000002
..y_wp.py:55 WPModule.mavlink_packet  4981   0.015244  0.018332  0.000004
..VLink_heartbeat_message.get_msgbuf  5009   0.014025  0.017612  0.000004
..on2.7/threading.py:64 Thread._note  16508  0.017393  0.017393  0.000001
...py:211 LinkModule.report_altitude  215    0.007073  0.015868  0.000074
...py:253 RallyModule.mavlink_packet  4981   0.011805  0.015075  0.000003
..5 LinkModule.handle_msec_timestamp  1291   0.011214  0.014540  0.000011
..e/api.py:383 APIModule.__on_change  1012   0.005797  0.012058  0.000012
..oxy/mavproxy.py:624 send_heartbeat  25     0.000246  0.011524  0.000461
..il.py:344 mavserial.wait_heartbeat  1      0.000007  0.011281  0.011281
..avutil.py:301 mavserial.recv_match  1      0.000130  0.011274  0.011274
..ega.py:6034 MAVLink.heartbeat_send  25     0.000225  0.011222  0.000449
../mavutil.py:281 mavserial.recv_msg  56     0.000408  0.011126  0.000199
..ardupilotmega.py:4771 MAVLink.send  28     0.000488  0.007685  0.000274
..ng.py:294 _Condition._release_save  2027   0.004717  0.006545  0.000003
...py:179 MPVehicle.notify_observers  1688   0.004762  0.006260  0.000004
..1931 MAVLink_ahrs_message.__init__  216    0.003039  0.006175  0.000029
..ilotmega.py:4710 MAVString.__str__  1506   0.003689  0.005909  0.000004
..y_misc.py:193 MiscModule.idle_task  3623   0.005691  0.005691  0.000002
..0 CalibrationModule.mavlink_packet  4981   0.005683  0.005683  0.000001
..pi.py:457 APIModule.send_to_server  4981   0.005340  0.005340  0.000001
..339 MAVLink_heartbeat_message.pack  50     0.000380  0.005312  0.000106
..112 MAVLink_heartbeat_message.pack  56     0.001190  0.005247  0.000094
..obal_position_int_message.__init__  215    0.002468  0.005116  0.000024
..7 MAVLink_raw_imu_message.__init__  215    0.002549  0.005107  0.000024
..AVLink_sys_status_message.__init__  215    0.002957  0.005092  0.000024
...py:50 CalibrationModule.idle_task  3623   0.004973  0.004973  0.000001
..py:37 BatteryModule.battery_report  116    0.002996  0.004970  0.000043
..nk_rc_channels_raw_message.get_seq  4981   0.004868  0.004868  0.000001
..:85 MAVLink_bad_data.get_srcSystem  5088   0.004732  0.004732  0.000001
.. MAVLink_attitude_message.__init__  215    0.002187  0.004565  0.000021
.. MAVLink_bad_data.get_srcComponent  5107   0.004483  0.004483  0.000001
..ule.py:67 ParamModule.vehicle_name  3623   0.004366  0.004366  0.000001
..ain.py:134 TerrainModule.idle_task  3623   0.004308  0.004308  0.000001
..VLink_scaled_imu2_message.__init__  215    0.002081  0.004183  0.000019
..VLink_param_value_message.__init__  501    0.001760  0.004106  0.000008
..oxy_log.py:182 LogModule.idle_task  3623   0.004067  0.004067  0.000001
.. MAVLink_hwstatus_message.__init__  216    0.001663  0.004009  0.000019
..a.py:6014 MAVLink.heartbeat_encode  25     0.000242  0.003993  0.000160
..nk_terrain_report_message.__init__  216    0.001896  0.003963  0.000018
..VLink_system_time_message.__init__  216    0.001805  0.003872  0.000018
..hon/droneapi/module/api.py:432 set  1720   0.003820  0.003820  0.000002
..2023 MAVLink_wind_message.__init__  216    0.001702  0.003809  0.000018
..k_rc_channels_raw_message.__init__  215    0.001931  0.003793  0.000018
.._servo_output_raw_message.__init__  215    0.002008  0.003733  0.000017
..184 MAVLink_ahrs2_message.__init__  215    0.001843  0.003704  0.000017
..controller_output_message.__init__  215    0.001831  0.003602  0.000017
..2 MAVLink_vfr_hud_message.__init__  216    0.001729  0.003553  0.000016
..Link_mount_status_message.__init__  216    0.001839  0.003510  0.000016
..k_scaled_pressure_message.__init__  215    0.001599  0.003448  0.000016
..Link_power_status_message.__init__  215    0.001504  0.003442  0.000016
..k_mission_current_message.__init__  215    0.001310  0.003326  0.000015
..9 MAVLink_meminfo_message.__init__  215    0.001377  0.003237  0.000015
..py:83 BatteryModule.battery_update  215    0.002409  0.003181  0.000015
..mavcrc.py:23 x25crc.accumulate_str  112    0.001762  0.003164  0.000028
..ink/mavutil.py:733 mavserial.write  28     0.000145  0.002810  0.000100
..al/serialposix.py:488 Serial.write  28     0.000499  0.002665  0.000095
..VLink_gps_raw_int_message.__init__  121    0.001176  0.002281  0.000019
..77 LinkModule.master_send_callback  28     0.000731  0.002135  0.000076
...py:98 BatteryModule.get_mav_param  116    0.000591  0.001403  0.000012
..MAVLink_heartbeat_message.__init__  54     0.000475  0.001048  0.000019
..lotmega.py:4708 MAVString.__init__  504    0.000895  0.000895  0.000002
..roxy/mavproxy.py:202 get_mav_param  116    0.000547  0.000812  0.000007
..module.py:47 BatteryModule.console  546    0.000693  0.000693  0.000001
..9 MAVLink.request_data_stream_send  2      0.000018  0.000665  0.000333
..odule.py:59 BatteryModule.settings  546    0.000641  0.000641  0.000001
..l.py:348 mavserial.param_fetch_all  1      0.000026  0.000528  0.000528
..45 MAVLink.param_request_list_send  1      0.000018  0.000496  0.000496
..tconsole.py:15 SimpleConsole.write  8      0.000055  0.000388  0.000048
..n2.7/threading.py:726 Thread.start  1      0.000021  0.000379  0.000379
..k_request_data_stream_message.pack  4      0.000025  0.000368  0.000092
..onsole.py:23 SimpleConsole.writeln  4      0.000021  0.000366  0.000091
..nk_sensor_offsets_message.__init__  20     0.000205  0.000355  0.000018
..on2.7/threading.py:603 _Event.wait  1      0.000026  0.000315  0.000315
..MAVLink.request_data_stream_encode  2      0.000018  0.000273  0.000137
..link/mavutil.py:1081 all_printable  39     0.000069  0.000264  0.000007
..ilotmega.py:48 MAVLink_header.pack  56     0.000158  0.000263  0.000005
..nk/mavutil.py:1306 mode_string_v10  29     0.000247  0.000247  0.000009
..ole.py:29 SimpleConsole.set_status  331    0.000237  0.000237  0.000001
..nk_param_request_list_message.pack  2      0.000015  0.000217  0.000109
..vlink/mavutil.py:1070 is_printable  39     0.000048  0.000195  0.000005
.. MAVLink.param_request_list_encode  1      0.000021  0.000172  0.000172
..thon2.7/curses/ascii.py:62 isprint  39     0.000055  0.000147  0.000004
...py:4720 MAVLink_bad_data.__init__  20     0.000052  0.000132  0.000007
..tmega.py:4781 MAVLink.bytes_needed  93     0.000088  0.000113  0.000001
..7/threading.py:656 Thread.__init__  1      0.000024  0.000097  0.000097
..python2.7/curses/ascii.py:48 _ctoi  58     0.000075  0.000093  0.000002
..s/serial/serialutil.py:65 to_bytes  28     0.000071  0.000090  0.000003
..util.py:642 mavserial.motors_armed  29     0.000084  0.000084  0.000003
..avutil.py:365 mavserial.time_since  12     0.000063  0.000072  0.000006
../mavproxy.py:613 check_link_status  8      0.000064  0.000070  0.000009
..AVLink_statustext_message.__init__  3      0.000022  0.000056  0.000019
..mavutil.py:332 mavserial.mavlink10  25     0.000055  0.000055  0.000002
..b/python2.7/threading.py:542 Event  1      0.000006  0.000041  0.000041
..link/mavwp.py:31 MAVWPLoader.count  12     0.000031  0.000039  0.000003
..thon2.7/threading.py:242 Condition  2      0.000012  0.000038  0.000019
..7/threading.py:561 _Event.__init__  1      0.000007  0.000035  0.000035
..2.7/threading.py:866 Thread.__stop  1      0.000010  0.000034  0.000034
..157 mavserial.auto_mavlink_version  4      0.000027  0.000030  0.000008
..quest_data_stream_message.__init__  2      0.000012  0.000028  0.000014
..reading.py:260 _Condition.__init__  2      0.000024  0.000025  0.000013
..lib/mp_module.py:95 LinkModule.say  1      0.000004  0.000024  0.000024
..aram_request_list_message.__init__  1      0.000007  0.000023  0.000023
..eading.py:400 _Condition.notifyAll  1      0.000003  0.000020  0.000020
..y/MAVProxy/mavproxy.py:90 say_text  1      0.000004  0.000019  0.000019
..hreading.py:709 Thread._set_daemon  1      0.000011  0.000018  0.000018
..vutil.py:201 mavserial.pre_message  56     0.000014  0.000014  0.000000
...7/threading.py:1024 Thread.daemon  1      0.000006  0.000007  0.000007
..s/lib/rline.py:28 rline.set_prompt  1      0.000003  0.000006  0.000006
..ilotmega.py:4702 MAVError.__init__  1      0.000005  0.000005  0.000005
...7/threading.py:59 Thread.__init__  4      0.000004  0.000004  0.000001
..reading.py:1008 _MainThread.daemon  1      0.000003  0.000003  0.000003
...7/threading.py:1152 currentThread  1      0.000003  0.000003  0.000003
..n2.7/threading.py:570 _Event.isSet  2      0.000001  0.000001  0.000001
..k/mavutil.py:61 evaluate_condition  1      0.000001  0.000001  0.000001

name           tid              ttot      scnt        
Thread         140217623496448  0.560475  3721      
_MainThread    140218199156544  0.054530  244       
Thread         140217926276864  0.054471  3592   

native, but still using parse_char

kevinh@kevin-think:~/development/drone$ mavproxy.py --master=/dev/ttyUSB0,921600 --profile --daemon --rtscts --streamrate=10
FIXME - using native code - remove this string
Logging to mav.tlog
Running script /home/kevinh/.mavinit.scr
-> set moddebug 2
-> module load droneapi.module.api
Traceback (most recent call last):
  File "/home/kevinh/development/drone/MAVProxy/MAVProxy/mavproxy.py", line 258, in load_module
    m = import_package(modpath)
  File "/home/kevinh/development/drone/MAVProxy/MAVProxy/mavproxy.py", line 388, in import_package
    mod = __import__(name)
ImportError: No module named mavproxy_droneapi.module.api

DroneAPI loaded
Loaded module droneapi.module.api
RTL> Mode RTL
APM: ArduPlane V3.2.1beta1 (5d8cec23)
APM: PX4: a55016a5 NuttX: 29c0c2d1
APM: PX4v2 00270030 31334705 39343031
Received 501 parameters
Received 5001 packets, exiting.

Clock type: CPU
Ordered by: totaltime, desc

name                                  ncall  tsub      ttot      tavg      
..hon2.7/threading.py:752 Thread.run  1      0.000015  4.049905  4.049905
..MAVProxy/mavproxy.py:668 main_loop  1      0.171051  4.049889  4.049889
..oxy/mavproxy.py:467 process_master  2246   0.101324  2.531932  0.001127
..tmega.py:4853 MAVLink.parse_buffer  2246   0.025571  2.096009  0.000933
..lotmega.py:4797 MAVLink.parse_char  7318   0.100779  2.077796  0.000284
...py:230 LinkModule.master_callback  5001   0.630832  1.777345  0.000355
..oxy/mavproxy.py:633 periodic_tasks  3933   0.338318  0.974033  0.000248
..b/python2.7/Queue.py:150 Queue.get  727..  0.090511  0.794078  0.000109
..7/threading.py:309 _Condition.wait  192..  0.045756  0.531229  0.000276
..mp_module.py:83 ParamModule.master  14217  0.034173  0.311258  0.000022
..b/python2.7/Queue.py:107 Queue.put  7276   0.085233  0.300662  0.000041
..oxy/mavproxy.py:186 MPState.master  14217  0.208290  0.277085  0.000019
../python2.7/Queue.py:93 Queue.empty  13329  0.091700  0.229291  0.000017
..threading.py:373 _Condition.notify  14553  0.095971  0.223572  0.000015
..link/mavutil.py:723 mavserial.recv  2380   0.014953  0.206667  0.000087
..ial/serialposix.py:453 Serial.read  2380   0.075817  0.191714  0.000081
..y:4792 MAVLink.__parse_char_native  7318   0.022241  0.168464  0.000023
..param.py:232 ParamModule.idle_task  3933   0.040023  0.167096  0.000042
...py:228 ParamModule.mavlink_packet  5001   0.025834  0.153906  0.000031
..util.py:209 mavserial.post_message  10002  0.119709  0.146667  0.000015
..py:66 TerrainModule.mavlink_packet  5001   0.022547  0.128143  0.000026
..til.py:1055 periodic_event.trigger  28600  0.100941  0.125085  0.000004
..ings.py:104 MPSettings.__getattr__  76450  0.110085  0.110085  0.000001
..eading.py:300 _Condition._is_owned  16475  0.049225  0.104247  0.000006
..pi.py:396 APIModule.mavlink_packet  5001   0.048741  0.088563  0.000018
../mp_module.py:43 LinkModule.module  27531  0.058254  0.085659  0.000003
..y/mavproxy.py:595 set_stream_rates  3934   0.051187  0.075132  0.000019
..proxy_wp.py:105 WPModule.idle_task  3933   0.025630  0.065370  0.000017
..ython2.7/Queue.py:200 Queue._qsize  22526  0.044856  0.063992  0.000003
..MAVLink_heartbeat_message.get_type  86437  0.061720  0.061720  0.000001
..py:92 BatteryModule.mavlink_packet  5001   0.024272  0.061274  0.000012
..MAVLink_heartbeat_message.__init__  5030   0.034508  0.048484  0.000010
.._rally.py:45 RallyModule.idle_task  3933   0.017396  0.039131  0.000010
.._fence.py:50 FenceModule.idle_task  3933   0.014233  0.035062  0.000009
..xy_link.py:49 LinkModule.idle_task  3933   0.015566  0.034925  0.000009
..e.py:59 FenceModule.mavlink_packet  5001   0.022347  0.029457  0.000006
../mp_module.py:51 LinkModule.status  31175  0.028734  0.028734  0.000001
..xy_link.py:173 LinkModule.get_usec  5030   0.024032  0.028192  0.000006
..le.py:36 LinkModule.mavlink_packet  50010  0.027825  0.027825  0.000001
..param.py:43 ParamState.fetch_check  3933   0.011508  0.027429  0.000007
..oxy/mavproxy.py:180 MPState.module  27531  0.027405  0.027405  0.000001
..log.py:25 LogModule.mavlink_packet  5001   0.018303  0.025103  0.000005
../python2.7/Queue.py:204 Queue._put  7276   0.019358  0.024947  0.000003
..vproxy_rc.py:21 RCModule.idle_task  3933   0.010228  0.023658  0.000006
..module.py:26 RelayModule.idle_task  35397  0.020999  0.020999  0.000001
..py:297 _Condition._acquire_restore  1922   0.006747  0.020211  0.000011
../python2.7/Queue.py:208 Queue._get  7276   0.014847  0.019443  0.000003
..3 ParamState.handle_mavlink_packet  5001   0.014998  0.018891  0.000004
..VLink_heartbeat_message.get_msgbuf  5030   0.013889  0.018031  0.000004
..y_wp.py:55 WPModule.mavlink_packet  5001   0.014693  0.017922  0.000004
..on2.7/threading.py:64 Thread._note  16477  0.017114  0.017114  0.000001
..5 LinkModule.handle_msec_timestamp  1367   0.012045  0.015310  0.000011
..oxy/mavproxy.py:624 send_heartbeat  26     0.000321  0.014753  0.000567
...py:211 LinkModule.report_altitude  227    0.006551  0.014413  0.000063
..ega.py:6034 MAVLink.heartbeat_send  26     0.000297  0.014366  0.000553
..e/api.py:383 APIModule.__on_change  1065   0.007168  0.014317  0.000013
...py:253 RallyModule.mavlink_packet  5001   0.010963  0.014198  0.000003
..mega.py:41 MAVLink_header.__init__  5088   0.014078  0.014078  0.000003
..il.py:344 mavserial.wait_heartbeat  1      0.000007  0.013923  0.013923
..avutil.py:301 mavserial.recv_match  1      0.000126  0.013917  0.013917
../mavutil.py:281 mavserial.recv_msg  63     0.000558  0.013768  0.000219
..ardupilotmega.py:4771 MAVLink.send  29     0.000567  0.009636  0.000332
...py:179 MPVehicle.notify_observers  1779   0.005452  0.007149  0.000004
..339 MAVLink_heartbeat_message.pack  52     0.000494  0.007033  0.000135
..112 MAVLink_heartbeat_message.pack  58     0.001473  0.006784  0.000117
..y_misc.py:193 MiscModule.idle_task  3933   0.006439  0.006439  0.000002
..ain.py:134 TerrainModule.idle_task  3933   0.006401  0.006401  0.000002
...py:50 CalibrationModule.idle_task  3933   0.005813  0.005813  0.000001
..ule.py:67 ParamModule.vehicle_name  3933   0.005623  0.005623  0.000001
..ng.py:294 _Condition._release_save  1922   0.004078  0.005529  0.000003
..py:37 BatteryModule.battery_report  124    0.003193  0.005388  0.000043
..a.py:6014 MAVLink.heartbeat_encode  26     0.000286  0.005274  0.000203
..0 CalibrationModule.mavlink_packet  5001   0.005103  0.005103  0.000001
..y:85 MAVLink_message.get_srcSystem  5094   0.004966  0.004966  0.000001
..pi.py:457 APIModule.send_to_server  5001   0.004893  0.004893  0.000001
..mega.py:91 MAVLink_message.get_seq  5001   0.004872  0.004872  0.000001
..oxy_log.py:182 LogModule.idle_task  3933   0.004791  0.004791  0.000001
..8 MAVLink_message.get_srcComponent  5094   0.004589  0.004589  0.000001
..mavcrc.py:23 x25crc.accumulate_str  116    0.002159  0.004122  0.000036
..hon/droneapi/module/api.py:432 set  1824   0.003793  0.003793  0.000002
..erator/mavcrc.py:6 x25crc.__init__  58     0.000430  0.003628  0.000063
..ink/mavutil.py:733 mavserial.write  29     0.000188  0.003349  0.000115
..al/serialposix.py:488 Serial.write  29     0.000683  0.003162  0.000109
..py:83 BatteryModule.battery_update  226    0.002230  0.002937  0.000013
..77 LinkModule.master_send_callback  29     0.000985  0.002714  0.000094
..tor/mavcrc.py:14 x25crc.accumulate  116    0.001770  0.001770  0.000015
...py:98 BatteryModule.get_mav_param  124    0.000688  0.001542  0.000012
..9 MAVLink.request_data_stream_send  2      0.000020  0.000969  0.000484
..roxy/mavproxy.py:202 get_mav_param  124    0.000642  0.000854  0.000007
..MAVLink_heartbeat_message.__init__  26     0.000331  0.000687  0.000026
..module.py:47 BatteryModule.console  577    0.000679  0.000679  0.000001
..odule.py:59 BatteryModule.settings  577    0.000669  0.000669  0.000001
..k_request_data_stream_message.pack  4      0.000064  0.000428  0.000107
..l.py:348 mavserial.param_fetch_all  1      0.000025  0.000388  0.000388
..45 MAVLink.param_request_list_send  1      0.000018  0.000356  0.000356
..onsole.py:23 SimpleConsole.writeln  4      0.000022  0.000339  0.000085
..tconsole.py:15 SimpleConsole.write  4      0.000032  0.000314  0.000079
..nk/mavutil.py:1306 mode_string_v10  31     0.000310  0.000310  0.000010
..ilotmega.py:48 MAVLink_header.pack  58     0.000180  0.000303  0.000005
..MAVLink.request_data_stream_encode  2      0.000023  0.000302  0.000151
..ole.py:29 SimpleConsole.set_status  350    0.000275  0.000275  0.000001
..tmega.py:4781 MAVLink.bytes_needed  134    0.000176  0.000219  0.000002
..nk_param_request_list_message.pack  2      0.000014  0.000167  0.000084
.. MAVLink.param_request_list_encode  1      0.000031  0.000143  0.000143
..n2.7/threading.py:726 Thread.start  1      0.000014  0.000128  0.000128
..s/serial/serialutil.py:65 to_bytes  29     0.000088  0.000118  0.000004
..util.py:642 mavserial.motors_armed  31     0.000110  0.000110  0.000004
..on2.7/threading.py:603 _Event.wait  1      0.000020  0.000083  0.000083
..7/threading.py:656 Thread.__init__  1      0.000018  0.000067  0.000067
../mavproxy.py:613 check_link_status  8      0.000062  0.000066  0.000008
..mavutil.py:332 mavserial.mavlink10  26     0.000066  0.000066  0.000003
..avutil.py:365 mavserial.time_since  12     0.000055  0.000064  0.000005
..link/mavwp.py:31 MAVWPLoader.count  12     0.000044  0.000052  0.000004
..2.7/threading.py:866 Thread.__stop  1      0.000016  0.000043  0.000043
..lib/mp_module.py:95 LinkModule.say  1      0.000006  0.000031  0.000031
..quest_data_stream_message.__init__  2      0.000015  0.000030  0.000015
..b/python2.7/threading.py:542 Event  1      0.000005  0.000027  0.000027
..y/MAVProxy/mavproxy.py:90 say_text  1      0.000004  0.000026  0.000026
..thon2.7/threading.py:242 Condition  2      0.000007  0.000023  0.000012
..7/threading.py:561 _Event.__init__  1      0.000005  0.000022  0.000022
..eading.py:400 _Condition.notifyAll  1      0.000009  0.000022  0.000022
..aram_request_list_message.__init__  1      0.000008  0.000019  0.000019
..vutil.py:201 mavserial.pre_message  63     0.000017  0.000017  0.000000
..reading.py:260 _Condition.__init__  2      0.000015  0.000017  0.000008
..hreading.py:709 Thread._set_daemon  1      0.000008  0.000013  0.000013
..s/lib/rline.py:28 rline.set_prompt  1      0.000005  0.000013  0.000013
..157 mavserial.auto_mavlink_version  1      0.000008  0.000009  0.000009
...7/threading.py:1024 Thread.daemon  1      0.000004  0.000005  0.000005
...7/threading.py:59 Thread.__init__  4      0.000003  0.000003  0.000001
...7/threading.py:1152 currentThread  1      0.000002  0.000002  0.000002
..reading.py:1008 _MainThread.daemon  1      0.000002  0.000002  0.000002
..n2.7/threading.py:570 _Event.isSet  2      0.000001  0.000001  0.000001
..k/mavutil.py:61 evaluate_condition  1      0.000001  0.000001  0.000001

name           tid              ttot      scnt        
Thread         140572053894912  0.620014  3699      
_MainThread    140572632536896  0.046768  258       
Thread         140572356572928  0.046761  3545      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment