This is a small proprietary Qualcomm program which can store DIAG logs on the filesystem.

It features the following --help output:

 Usage for diag_mdlog:

-f, --filemsm:   mask file name for MSM
-m, --filemdm:   mask file name for MDM
-l, --filelist:  name of file containing list of mask files
-o, --output:    output directory name
-p, --peripheral:        bit mask for the peripherals interested
-s, --size:      maximum file size in MB
-w, --wait:      waiting for directory
-n, --number:    maximum file number
-k, --kill:      kill existing instance of diag_mdlog
-c  --cleanmask:         Send mask cleanup to modem at exit
-d  --disablecon:        Disable console messages
-e  --enablelock:        Run using wake lock to keep APPS processor on
-b  --nonrealtime:       Have peripherals buffer data and send data in non-real-time
-r  --renamefiles:       Rename dir/file names to time when closed
-a  --hdlcdisable:       Disbale hdlc encoding
-h, --help:      usage help

e.g. diag_mdlog -f <mask_file name> -o <output dir> -s <size in bytes> -c

mask files (--filemsm, --filemdm)

It works using so-called mask files which contain the raw byte sequences to be sent to /dev/diag to enable certain log masks. The defailed format is TBD.

The default mask file name (if none is specified) depends on the processor that you want to diag:



As an alternative to mask files, there s the filelist_ concept, whcih is a text file containing a list of mask files. The default filelist file is /sdcard/diag_logs/Diag_list.txt


This waits for the specified directory to become available/writable before proceeding. Useful in case you wait for mountin an SD card or the like.


This clears the debug mask at the time of a clean shutdown of the process


Renames the files when they are closed. Filenames will be based on timestamps in a format of /dir/diag_log_%Y%m%d_%H%M%S.qmdl where dir corresponds to the --outputdir option given.


The default output directories are

Updated by laforge almost 6 years ago · 2 revisions

Add picture from clipboard (Maximum size: 48.8 MB)