Project

General

Profile

Diag » History » Version 8

laforge, 12/17/2016 10:54 AM

1 4 laforge
{{>toc}}
2
3 1 laforge
h1. Diag
4
5 6 laforge
FIXME
6
7 1 laforge
h2. Acronyms
8
9
|DCI|Diag Consumer Interface|
10
11 4 laforge
h2. Child Pages
12
13
{{child_pages()}}
14 6 laforge
15
h2. Subsystems
16
17
h3. Logging
18
19
Logging works by so-called log-codes.  The Log code identifies the source/category of the logged information.  Log codes are 16bit unsigned integers.
20
21
|_.Base Code|_.Purpose|
22
|0x1000|CDMA 1x|
23
|0x4000|WCDMA|
24
|0x5000|GSM|
25
|0x6000|Location Based Services|
26
|0x7000|UMTS|
27
|0x8000|TDMA|
28
|0xA000|DTV|
29
|0xB000|APPS|
30
|0xB010|LTE (until 0xB1FF)|
31
|0xB400|WIMAX|
32
|0xC000|DSP|
33
|0xD000|TD-SCDMA (until 0xD1FF)|
34
|0xF000|LOG TOOLS|
35 4 laforge
36 3 laforge
h2. Kernel support
37
38 1 laforge
See [[Qualcomm_Kernel#diag]]
39
40 4 laforge
h2. Library
41 1 laforge
42 4 laforge
There is @/usr/lib/libdiag.so.1@ which is linked by virtually any Qualcomm or Quectel proprietary program running on the Linux in the Modem.
43
44
it offers the follwing symbols:
45
<pre>
46
47
4af43a7c g    DF .text»·0000014c  Base        log_submit
48
4af4d128 g    DO .data»·000001d0  Base        pools
49
4af40578 g    DF .text»·0000000c  Base        diag_vote_md_real_time
50
4af45f54 g    DF .text»·000000b0  Base        DiagSvc_Free
51
4af42f98 g    DF .text»·000000ec  Base        diag_dci_get_real_time_status_proc
52
4af45278 g    DF .text»·00000080  Base        diagpkt_subsys_get_delayed_rsp_id
53
4af456f8 g    DF .text»·000001cc  Base        diagpkt_subsys_alloc_v2
54
4af3fed4 g    DF .text»·00000450  Base        diag_read_mask_file_list
55
4af4515c g    DF .text»·00000020  Base        diagpkt_subsys_get_cmd_code
56
4af436f8 g    DF .text»·00000024  Base        Diag_LSM_Event_DeInit
57
4af3cd80 g    DF .text»·00000174  Base        diag_wakelock_init
58
4af4ecf8 g    DO .data»·000001f4  Base        mask_file2
59
4b044b30 g    DO .bss»··00000004  Base        cleanup_mask
60
4af41f54 g    DF .text»·00000160  Base        diag_register_dci_client
61
4af4eeec g    DO .data»·000001f4  Base        mask_file
62
4af444e8 g    DF .text»·000000e8  Base        msg_send_var
63
4af458c4 g    DF .text»·000000ac  Base        diagpkt_subsys_alloc_v2_delay
64
4b044b5c g    DO .bss»··00000004  Base        log_to_memory
65
4af453f4 g    DF .text»·000000b8  Base        diagpkt_alloc
66
4b025b98 g    DO .bss»··00000004  Base        db_thread_initialized
67
4af3bacc g    DF .init»·00000000  Base        _init
68
4b044a28 g    DO .bss»··00000030  Base        stop_cond
69
4af41808 g    DF .text»·00000110  Base        diag_hdlc_toggle
70
4af3cf5c g    DF .text»·000000b0  Base        diag_wakelock_acquire
71
4b044b6c g    DO .bss»··00000004  Base        parser_state
72
4b044b60 g    DO .bss»··00000004  Base        num_bytes_read
73
4af43884 g    DF .text»·00000054  Base        log_update_dci_mask
74
4af40324 g    DF .text»·00000004  Base        send_mask_modem
75
4af4f310 g    DO .data»·00000004  Base        qsr4_db_file_fd
76
4b0448c8 g    DO .bss»··00000098  Base        qsr4_db_write_buf_pool
77
4af4342c g    DF .text»·0000005c  Base        event_update_mask
78
4af3c2b0 g    DF .text»·00000014  Base        mask_sync_initialize
79
4b042e00 g    DO .bss»··00001388  Base        file_name_curr
80
4af445d0 g    DF .text»·00000264  Base        msg_sprintf
81
4af4e910 g    DO .data»·000001f4  Base        mask_file_mdm2
82
4af435a8 g    DF .text»·000000f0  Base        event_report_payload
83
4af46088 g    DF .text»·00000098  Base        DiagSvc_Malloc_Init
84
4af42190 g    DF .text»·00000194  Base        diag_release_dci_client
85
4af3ccb0 g    DF .text»·00000054  Base        update_sync_mask
86
4af3f934 g    DF .text»·0000014c  Base        diag_send_socket_data
87
4af420b4 g    DF .text»·00000094  Base        diag_register_dci_stream_proc
88
4af45e68 g    DF .text»·000000ec  Base        DiagSvc_Malloc
89
4b044a58 g    DO .bss»··00000028  Base        buffer_init
90
4af4bfd8 g    DO .rodata»·······00000004  Base        msg_mask_tbl_size
91
4b025b8c g    DO .bss»··00000004  Base        curr_write_idx
92
4af46834 g    DF .text»·00000094  Base        diag_logger_flush
93
4b044aa8 g    DO .bss»··00000028  Base        pool0_buffers
94
4af43bc8 g    DF .text»·0000000c  Base        log_set_length
95
4b044b7c g    DO .bss»··00000001  Base        hdlc_disabled
96
4af4f314 g    DO .data»·00000028  Base        fd_qsr4_xml
97
4af4d394 g    DO .data»·000001f4  Base        qsr4_xml_file_name
98
4af45c30 g    DF .text»·00000238  Base        diagpkt_LSM_process_request
99
4af40680 g    DF .text»·0000000c  Base        diag_get_real_time_status
100
4af44d70 g    DF .text»·00000100  Base        Diag_LSM_Pkt_DeInit
101
4af40864 g    DF .text»·000004f4  Base        flush_buffer
102
4af40494 g    DF .text»·00000018  Base        diag_callback_send_data
103
4b044188 g    DO .bss»··00000200  Base        dci_cumulative_event_mask
104
4b044b44 g    DO .bss»··00000004  Base        dci_transaction_id
105
4af42940 g    DF .text»·0000010c  Base        diag_get_health_stats_proc
106
4b044b10 g    DO .bss»··00000018  Base        stop_mutex
107
4af42a4c g    DF .text»·0000002c  Base        diag_get_health_stats
108
4af43a68 g    DF .text»·00000014  Base        log_free
109
4af4eb04 g    DO .data»·000001f4  Base        mask_file_mdm
110
4af452f8 g    DF .text»·00000080  Base        diagpkt_subsys_reset_delayed_rsp_id
111
4af46418 g    DF .text»·00000210  Base        diag_logger_init
112
4af3c2c4 g    DF .text»·00000040  Base        dummy_handler
113
4af3f870 g    DF .text»·000000c4  Base        diag_send_data
114
4af488ac g    DF .text»·00000234  Base        diag_kill_qshrink4_threads
115
4af41b20 g    DF .text»·0000002c  Base        ts_get_lohi
116
4af45378 g    DF .text»·0000007c  Base        diagpkt_subsys_set_rsp_cnt
117
4af482b4 g    DF .text»·00000030  Base        diag_notify_parser_thread
118
4af42c88 g    DF .text»·000000f8  Base        diag_disable_all_logs
119
4af45a2c g    DF .text»·00000204  Base        diagpkt_commit
120
4b0238e4 g    DO .bss»··00000004  Base        proc_type
121
4af42670 g    DF .text»·00000160  Base        diag_log_stream_config
122
4af43c28 g    DF .text»·00000034  Base        log_status
123
4af4415c g    DF .text»·000000a4  Base        msg_send
124
4af3e4b0 g    DF .text»·00000470  Base        WriteToDisk
125
4af43d04 g    DF .text»·00000050  Base        Diag_LSM_Log_DeInit
126
4af4f2d4 g    DO .data»·00000004  Base        fd_dev
127
4af43084 g    DF .text»·0000000c  Base        diag_dci_get_real_time_status
128
4b0449c4 g    DO .bss»··00000032  Base        qsr4_db_cmd_req_buf
129
4af45694 g    DF .text»·00000064  Base        diagpkt_subsys_alloc
130
4af3cc64 g    DF .text»·0000004c  Base        get_sync_mask
131
4af425bc g    DF .text»·000000a8  Base        diag_get_dci_support_list_proc
132
4af40584 g    DF .text»·000000fc  Base        diag_get_real_time_status_proc
133
4b044af8 g    DO .bss»··00000018  Base        qsr4_read_db_mutex
134
4b044388 g    DO .bss»··000001f4  Base        dir_name
135
4af3d210 g    DF .text»·0000005c  Base        diag_set_socket_fd
136
4af4115c g    DF .text»·0000001c  Base        diag_switch_logging_proc
137
4af45124 g    DF .text»·0000000c  Base        diagpkt_get_cmd_code
138
4af4517c g    DF .text»·00000080  Base        diagpkt_subsys_get_status
139
4b044b58 g    DO .bss»··00000004  Base        in_read
140
4af43698 g    DF .text»·00000060  Base        Diag_LSM_Event_Init
141
4b044b48 g    DO .bss»··00000004  Base        diag_dci_error_type
142
4af42d80 g    DF .text»·000000f8  Base        diag_disable_all_events
143
4b044960 g    DO .bss»··00000064  Base        pid_file
144
4b044b70 g    DO .bss»··00000004  Base        qsr4_db_parser_thread_hdl
145
4b044b68 g    DO .bss»··00000004  Base        num_dci_proc
146
4b025b84 g    DO .bss»··00000004  Base        in_wait_for_peripheral_status
147
4b044b78 g    DO .bss»··00000004  Base        write_in_progress
148
4af44d34 g    DF .text»·0000003c  Base        Diag_LSM_Pkt_Init
149
4af4d328 g    DO .data»·00000004  Base        max_file_size
150
4af41a18 g    DF .text»·00000108  Base        ts_get
151
4af42b80 g    DF .text»·00000108  Base        diag_get_event_status
152
4af43bfc g    DF .text»·00000014  Base        log_set_timestamp
153
4b044b34 g    DO .bss»··00000004  Base        curr_read
154
4af43090 g    DF .text»·000000b4  Base        diag_register_dci_signal_data
155
4af45970 g    DF .text»·00000040  Base        diagpkt_shorten
156
4b025b90 g    DO .bss»··00000004  Base        curr_read_idx
157
4b044ad0 g    DO .bss»··00000028  Base        pool1_buffers
158
4af41d38 g    DF .text»·0000021c  Base        lookup_pkt_rsp_transaction
159
4b0238f0 g    DO .bss»··00000004  Base        diag_disable_console
160
4af4d320 g    DO .data»·00000004  Base        max_file_num
161
4af42324 g    DF .text»·00000298  Base        diag_send_dci_async_req
162
4af43c10 g    DF .text»·0000000c  Base        log_get_length
163
4af45130 g    DF .text»·0000000c  Base        diagpkt_set_cmd_code
164
4af451fc g    DF .text»·0000007c  Base        diagpkt_subsys_set_status
165
4af41744 g    DF .text»·000000c4  Base        diag_peripheral_buffering_drain_immediate
166
4b044770 g    DO .bss»··00000155  Base        event_mask
167
4af439b4 g    DF .text»·000000b4  Base        log_commit
168
4af4d324 g    DO .data»·00000004  Base        min_file_size
169
4b02394c g    DO .bss»··00000004  Base        gdwClientID
170
4af44200 g    DF .text»·000000b4  Base        msg_send_ts
171
4b044b74 g    DO .bss»··00000004  Base        read_thread_hdl
172
4af3d26c g    DF .text»·0000004c  Base        valid_token
173
4af41918 g    DF .text»·0000005c  Base        add_guid_to_qshrink4_header
174
4b03e240 g    DO .bss»··00004bc0  Base        msg_mask
175
4b0238f4 g    DO .bss»··00000028  Base        file_list_size
176
4af43bd4 g    DF .text»·0000001c  Base        log_shorten
177
4af45a18 g    DF .text»·00000014  Base        diagpkt_free
178
4af4f2d8 g    DO .data»·00000008  Base        fd_socket
179
4b044b54 g    DO .bss»··00000004  Base        flush_log
180
4af482e4 g    DF .text»·000002b4  Base        create_diag_qshrink4_db_parser_thread
181
4af3fb3c g    DF .text»·00000398  Base        diag_read_mask_file
182
4af43144 g    DF .text»·000000ac  Base        diag_deregister_dci_signal_data
183
4b044b64 g    DO .bss»··00000004  Base        num_dci_clients_event
184
4af4d358 g    DO .data»·0000003c  Base        proc_name
185
4af41d10 g    DF .text»·00000028  Base        diag_lsm_dci_deinit
186
4af3d00c g    DF .text»·000000b0  Base        diag_wakelock_release
187
4b025ba0 g    DO .bss»··000186a0  Base        read_buffer
188
4af4513c g    DF .text»·00000020  Base        diagpkt_subsys_get_id
189
4b04457c g    DO .bss»··000001f4  Base        peripheral_name
190
4af411a4 g    DF .text»·0000042c  Base        Diag_LSM_Init
191
4af415d0 g    DF .text»·00000174  Base        diag_configure_peripheral_buffering_tx_mode
192
4b044b38 g    DO .bss»··00000004  Base        curr_write
193
4af404ac g    DF .text»·00000018  Base        diag_callback_send_data_hdlc
194
4af448dc g    DF .text»·000000ac  Base        qsr_msg_send_1
195
4af44988 g    DF .text»·000000b4  Base        qsr_msg_send_2
196
4b044b3c g    DO .bss»··00000004  Base        db_write_thread_hdl
197
4af44bd4 g    DF .text»·00000024  Base        Diag_LSM_Msg_Init
198
4af44a3c g    DF .text»·000000bc  Base        qsr_msg_send_3
199
4af4d2f8 g    DO .data»·00000028  Base        token_list
200
4af3d148 g    DF .text»·00000054  Base        diag_has_remote_device
201
4af3f754 g    DF .text»·0000011c  Base        diag_register_remote_callback
202
4b025b88 g    DO .bss»··00000004  Base        in_write
203
4b02391c g    DO .bss»··00000028  Base        file_list
204
4af46120 g    DF .text»·00000238  Base        process_incoming_data
205
4af3d3d4 g    DF .text»·000002dc  Base        delete_log
206
4af3d6b0 g    DF .text»·00000e00  Base        log_to_device
207
4af4d354 g    DO .data»·00000004  Base        logging_mode
208
4af43bf0 g    DF .text»·0000000c  Base        log_set_code
209
4af454ac g    DF .text»·000001e8  Base        diagpkt_delay_commit
210
4b044b50 g    DO .bss»··00000004  Base        flush_in_progress
211
4af431f0 g    DF .text»·00000064  Base        diag_send_to_output
212
4af3d0bc g    DF .text»·00000008  Base        diag_get_max_channels
213
4af43c5c g    DF .text»·000000a8  Base        Diag_LSM_Log_Init
214
4af4f0e0 g    DO .data»·000001f4  Base        file_name_del
215
4b023944 g    DO .bss»··00000004  Base        uart_logging_proc
216
4af46004 g    DF .text»·00000084  Base        DiagSvc_Malloc_Exit
217
4af4d588 g    DO .data»·00001388  Base        output_dir
218
4af427d0 g    DF .text»·00000170  Base        diag_event_stream_config
219
4af4068c g    DF .text»·000001d8  Base        Diag_LSM_DeInit
220
4af44e70 g    DF .text»·000002b4  Base        diagpkt_tbl_reg
221
4af42e78 g    DF .text»·00000120  Base        diag_dci_vote_real_time
222
4b025b94 g    DO .bss»··00000004  Base        kill_thread
223
4b023948 g    DO .bss»··00000004  Base        count_written_bytes_1
224
4af44834 g    DF .text»·000000a8  Base        qsr_msg_send
225
4af434f4 g    DF .text»·000000b4  Base        event_report
226
4af4f30c g    DO .data»·00000004  Base        diag_fd
227
4af43488 g    DF .text»·0000006c  Base        event_update_dci_mask
228
4af42664 g    DF .text»·0000000c  Base        diag_get_dci_support_list
229
4af437d8 g    DF .text»·000000ac  Base        log_update_mask
230
4af48598 g    DF .text»·00000314  Base        parse_data_for_qsr4_db_file_op_rsp
231
4af4d32c g    DO .data»·00000028  Base        file_list_index
232
4b0238ec g    DO .bss»··00000004  Base        rename_file_names
233
4af3f694 g    DF .text»·000000c0  Base        diag_register_callback
234
4af41b84 g    DF .text»·0000018c  Base        diag_lsm_dci_init
235
4af404c4 g    DF .text»·000000b4  Base        diag_vote_md_real_time_proc
236
4af442b4 g    DF .text»·000000b4  Base        msg_send_1
237
4af44368 g    DF .text»·000000bc  Base        msg_send_2
238
4af44424 g    DF .text»·000000c4  Base        msg_send_3
239
4af3cf48 g    DF .text»·00000014  Base        diag_is_wakelock_init
240
4b044b4c g    DO .bss»··00000004  Base        disk_write_hdl
241
4af3d19c g    DF .text»·00000074  Base        diag_register_socket_cb
242
4af44c10 g    DF .text»·000000c0  Base        msg_update_mask
243
4af41974 g    DF .text»·00000014  Base        diag_set_peripheral_mask
244
4af438d8 g    DF .text»·000000dc  Base        log_alloc
245
4b044b40 g    DO .bss»··00000004  Base        dci_client_tbl
246
4af3cd04 g    DF .text»·0000007c  Base        do_mask_sync
247
4b044b7d g    DO .bss»··00000001  Base        write_qshrink_header
248
4af4f2e0 g    DO .data»·00000004  Base        fd_uart
249
4af44af8 g    DF .text»·000000dc  Base        qsr_msg_send_var
250
4b044b28 g    DO .bss»··00000008  Base        periph_info
251
4af468c8 g    DF .text»·00000074  Base        diag_logger_exit
252
4af3fa80 g    DF .text»·000000bc  Base        send_empty_mask
253
4b023954 g    DO .bss»··00000004  Base        gnDiag_LSM_Event_Initialized
254
4af459b0 g    DF .text»·00000068  Base        diagpkt_err_rsp
255
4af46628 g    DF .text»·0000020c  Base        diag_logger_write
256
4af42a78 g    DF .text»·00000108  Base        diag_get_log_status
257
4b0449f8 g    DO .bss»··00000030  Base        qsr4_read_db_cond
258
4b0238e8 g    DO .bss»··00000004  Base        rename_dir_name
259
4af3cef4 g    DF .text»·00000054  Base        diag_wakelock_destroy
260
4af42148 g    DF .text»·00000048  Base        diag_register_dci_stream
261
4af43c1c g    DF .text»·0000000c  Base        log_get_code
262
4af4f348 g    DO .data.rel.ro.local»····00000120  Base        msg_mask_tbl
263
4af44bf8 g    DF .text»·00000018  Base        Diag_LSM_Msg_DeInit
264
4af3d0c4 g    DF .text»·00000084  Base        to_integer
265
4af48e08 g    DF .fini»·00000000  Base        _fini
266
4af3d2b8 g    DF .text»·0000011c  Base        diag_get_peripheral_name_from_mask
267
4b044a80 g    DO .bss»··00000028  Base        count_written_bytes
268
4af41178 g    DF .text»·0000002c  Base        diag_switch_logging
269
4af4f2e4 g    DO .data»·00000028  Base        fd_md
270
</pre>
271 5 laforge
272
h3. Logging Service API
273
274
This is about sending log messages via the Diag interface.
275
276
|_.Function|_.Purpose|
277
|log_alloc(u16 code, len)|Allocate a buffer + fill header|
278
|log_shorten(ptr, len)|Shorten the length of a previously allocated buffer|
279
|log_commit(ptr)|Send the log to diag|
280
|log_free(ptr)|Free a buffer previously allocated with log_alloc()|
281
|log_submit(ptr)|Convenience wrapper around log_alloc()/memcpy()/log_commit()|
282
283 7 laforge
On the [[EC25]], it seems only the following Linux programs use the avove API to generate logs via Diag:
284
* @/usr/bin/cnss_diag@
285
* @/usr/bin/ftmdaemon@
286
* @/usr/bin/mbimd@
287
* @/usr/bin/test_diag@
288
289 5 laforge
h3. Diag Consumer Interface
290
291 1 laforge
This seems to be about implementing a program that consumes Diag events. You can register to certain events/masks and then receive the related information in call-backs.
292 8 laforge
293
|_.Function|_.Description|
294
|diag_lsm_dci_init()|Initialize DCI subsystem of libdiag|
295
|diag_register_dci_client()|Register a DCI client|
296
|diag_get_dci_support_list()|Get list of peripherals supported|
297
|diag_register_dci_stream()|Register call-backs for events and logs|
298
|diag_event_stream_config()|Set up event streaming to the client|
299
|diag_log_stream_config()|Specify array of requested log codes|
300
|diag_get_health_stats()|Get statistics about missed/succeeded logs and events|
301
|diag_register_dci_signal_data()|Request OS signal when DCI data is received|
Add picture from clipboard (Maximum size: 48.8 MB)