After the machine is flashed,the wlan_logs folder appears in the file, and the
log is continuously printd.

when i use the latest version to test ,the bug changed!

when i open the T card log,the wlan_logs disapper,so i record the analysis in
my blog.

Expected result

wlan_logs closed by default,when i open T card log ,the wlan_logs appears.

T card log

input telephone number “##87##
click the button that “manual test”
click the button “t card log”
choose “Method 2”


when i serch the code, cnss_diag_system has been compiled.so i suspect the
service did not start.
“/device/qcom/sdm660_64/init.target.rc”.i suspect the service add in
init_target.rc do not start.so i changed to start service in init.rc.


add in init.rc


//add wlan log
service cnss_diag /system/bin/cnss_diag_system -q -f
    class main
    user system
    group system wifi inet net_admin sdcard_rw media_rw diag

on property:sys.cnss_diag.enable=1
    start cnss_diag

when i change this case, i didnot get the Expected results.but when i input
in the bush “setprop sys.cnss_diag.enable 1”,the wlan_logs appears.
when i catch the logcat log,i found the problem

logcat -vv | grep scontext
cnss_diag_styste: type=1400 audit(0.0:52822): avc: denied{ create } for
scontext=u:r:cnss_diag_system:s0 tcontext=u:r:cnss_diag_system:s0
tclass=udp_socket permissive=0

so i need to add cnss_diag_system selinux

fix selinux

add cnss_diag_system selinux

/(vendor|system)/bin/cnss_diag_system   u:object_r:wcnss_service_exec:s0


# for wlan driver/fw logs
allow wcnss_service diag_device:chr_file { read write };

Root cause

the service donot start and selinux


“为什么要努力?” “想去的地方很远,想要的东西很贵,喜欢的人很优秀,父母的白发,朋友的约定,周围人的嘲笑,以及,天生傲骨。”


*评论支持代码高亮<pre class="prettyprint linenums">代码</pre>