{"id":252623,"date":"2015-03-08T06:02:02","date_gmt":"2015-03-08T02:02:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=252623"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=252623","title":{"rendered":"\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u0434 \u0447\u0438\u0449\u0435: \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f vsnprintf() \u0432 \u044f\u0434\u0440\u0435 Linux"},"content":{"rendered":"<p>     \t\u0421\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043a\u0443\u0447\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0441\u044b\u043b\u0430\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0432 \u0441\u043f\u0438\u0441\u043a\u0438 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c \u044f\u0434\u0440\u0430 Linux \u0438\u043d\u043e\u0433\u0434\u0430 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u043a\u0430\u0442\u044c. \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0431\u044b\u0432\u0430\u0435\u0442 \u0443\u0436\u0430\u0441\u043d\u044b\u0439 \u0438 \u043d\u0435\u043f\u043e\u0442\u0440\u0435\u0431\u043d\u044b\u0439 \u043a\u043e\u0434, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043b\u044e\u0434\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u044f\u0434\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u0432\u0441\u0435\u0445 \u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  \u041a\u043d\u0438\u0433\u0430 Linux Device Drivers \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430, \u0430 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u044b\u0439\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u0440\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0432 \u0437\u043d\u0430\u043d\u0438\u044f\u0445 \u0442\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0438\u0448\u0443\u0442 \u043a\u043e\u0434 \u0432 \u044f\u0434\u0440\u043e. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0435\u0447\u0430\u0442\u0438 \u0432 \u044f\u0434\u0440\u0435 Linux. \u041d\u0435 \u0441\u043c\u0443\u0449\u0430\u0439\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0432\u044b\u043d\u0435\u0441 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u0435\u0451 \u0438\u043c\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0421\u0438, \u0432 \u044f\u0434\u0440\u0435 \u0447\u0430\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>printk()<\/code> \u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0451.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u044f \u0432\u043e\u0437\u044c\u043c\u0443 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u0435 \u044f\u0434\u0440\u043e \u0432\u0435\u0440\u0441\u0438\u0438 <b>4.0-rc2<\/b>. \u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043b\u044e\u0431\u043e\u0439 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c printf(3).<\/p>\n<p>  \u0412\u0441\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <b>%p<\/b>. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0412 \u044f\u0434\u0440\u0435 \u0436\u0435 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u043f\u0443\u0442\u0451\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u043a \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"cpp\">%[\u0434\u043b\u0438\u043d\u0430 \u043f\u043e\u043b\u044f]p[\u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0432 \u0432\u0438\u0434\u0435 \u0431\u0443\u043a\u0432\u044b, \u0446\u0438\u0444\u0440\u044b \u0438\u043b\u0438 \u0438\u0445 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439] <\/code><\/pre>\n<p>  \u041d\u0438\u0436\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0432\u0441\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u0438 \u0434\u0430\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u0438\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.<\/p>\n<h3><font color=\"blue\">\u0423\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430<\/font><\/h3>\n<p>  <b>%pK<\/b><\/p>\n<p>  \u0422\u043e \u0436\u0435, \u0447\u0442\u043e \u0438 <b>%p<\/b>, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f kptr_restrict sysctl, \u043f\u0435\u0447\u0430\u0442\u0430\u044e\u0442\u0441\u044f 0&#8217;\u0438, \u0435\u0441\u043b\u0438 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0430\u0432.<\/p>\n<p>  <b>%pa[pd]<\/b><\/p>\n<p>  \u041f\u0435\u0447\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0430\u0434\u0440\u0435\u0441 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043b\u0438 DMA (phys_addr_t, dma_addr_t) \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u0430 resource_size_t. \u041f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">phys_addr_t pa; dma_addr_t da; pr_debug(&quot;Phys: %pa DMA: %pad\\n&quot;, &pa, &da); <\/code><\/pre>\n<h3><font color=\"blue\">\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430<\/font><\/h3>\n<p>  <b>%p[Mm][FR]<\/b><\/p>\n<p>  \u041f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 MAC \u0430\u0434\u0440\u0435\u0441, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u0431\u0443\u0444\u0435\u0440. <b>M<\/b> \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 MAC \u0430\u0434\u0440\u0435\u0441, <b>m<\/b> \u00ad\u2014 \u0431\u0435\u0437 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0439, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <b>R<\/b> \u0432 \u0440\u0435\u0432\u0435\u0440\u0441\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (\u0432\u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0431\u0430\u0439\u0442 \u0430\u0434\u0440\u0435\u0441\u0430).<\/p>\n<pre><code class=\"cpp\">u8 mac[ETH_ALEN]; pr_debug(&quot;%pMR\\n&quot;, mac); <\/code><\/pre>\n<p>  <b>%p[Ii]4[hnbl], %p[Ii]6[c], %p[Ii]S[pfschnbl]<\/b><\/p>\n<p>  \u041f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f\u0445 \u0430\u0434\u0440\u0435\u0441\u0430 IPv4 (__be32 addr), IPv6 (__be32 addr[4]) \u0438 struct sockaddr (\u0430\u0432\u0442\u043e\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435).<\/p>\n<h3><font color=\"blue\">\u0414\u0430\u043c\u043f \u0431\u0443\u0444\u0435\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/font><\/h3>\n<p>  <b>%*pE[achnops]<\/b><\/p>\n<p>  \u041f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438. \u0424\u043b\u0430\u0433\u0430\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"cpp\">const char *buf; int len; pr_debug(&quot;Buffer: %*pE Buffer[0-5]: %6pE\\n&quot;, len, buf, buf); <\/code><\/pre>\n<p>  <b>%*ph[CDN]<\/b><\/p>\n<p>  \u041f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0434\u0430\u043c\u043f \u043f\u0430\u043c\u044f\u0442\u0438 (\u0434\u043e 64 \u0431\u0430\u0439\u0442) \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438\u0440\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c: \u043f\u0440\u043e\u0431\u0435\u043b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, <b>C<\/b> \u2014 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435, <b>D<\/b> \u2014 \u0434\u0435\u0444\u0438\u0441\u044b, <b>N<\/b> \u2014 \u0431\u0435\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f.<\/p>\n<pre><code class=\"cpp\">u8 data[100]; pr_debug(&quot;Buf: %*phC\\n&quot;, (int)sizeof(buf), buf); \/* only first 64 bytes! *\/ <\/code><\/pre>\n<p>  <b>%pU[Ll][Bb]<\/b><\/p>\n<p>  \u041f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 UUID (\u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0432 16 \u0431\u0430\u0439\u0442) \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445. \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u043a\u0432 (\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438\u043b\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435) \u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0438\u0441\u0438 UUID: <b>B<\/b> \u0438\u043b\u0438 <b>b<\/b> \u2014 \u0441\u0442\u0430\u0440\u0448\u0438\u0435 \u0431\u0430\u0439\u0442\u044b \u0432\u043d\u0430\u0447\u0430\u043b\u0435, <b>L<\/b> \u0438\u043b\u0438 <b>l<\/b> \u2014 \u043c\u043b\u0430\u0434\u0448\u0438\u0435 \u0432\u043d\u0430\u0447\u0430\u043b\u0435.<\/p>\n<p>  <b>%*pb[l]<\/b><\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434\u0438\u0442 \u0434\u0430\u043c\u043f \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0438 \u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432 (cpumask, nodemask). \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 <b>l<\/b> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043c\u043f\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c\u0438. \u041f\u043e\u043b\u0435 \u0434\u043b\u0438\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<h3><font color=\"blue\">\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0438\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445<\/font><\/h3>\n<p>  <b>%p[Rr]<\/b><\/p>\n<p>  \u041f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 struct resource.<\/p>\n<p>  <b>%pV<\/b><\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 va_format \u0438 va_list. \u041f\u043e \u0441\u0443\u0442\u0438 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>vsnprintf()<\/code> \u0438\u0437-\u043f\u043e\u0434 \u0441\u0435\u0431\u044f \u0441\u0430\u043c\u043e\u0439. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 va_format \u0438 va_list!<\/p>\n<p>  <b>%pNF<\/b><\/p>\n<p>  \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0442\u0438\u043f\u0430 netdev_features_t.<\/p>\n<p>  <b>%pd[234], %pD[234]<\/b><\/p>\n<p>  \u0421\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u0435\u0447\u0430\u0442\u0438 \u043f\u0443\u0442\u0438 \u0438 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 (struct dentry, \u043f\u043e\u043b\u0435 d_name.name). <b>2<\/b>,<b>3<\/b> \u0438\u043b\u0438 <b>4<\/b> \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0443\u0442\u0438 (\u0441 \u043a\u043e\u043d\u0446\u0430). <b>%pD<\/b> \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0434\u043b\u044f struct file (f_path.dentry).<\/p>\n<h3><font color=\"blue\">\u041f\u0435\u0447\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443<\/font><\/h3>\n<p>  <b>%p[Ff], %p[Ss][R], %pB<\/b><\/p>\n<p>  \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u043f\u0435\u0447\u0430\u0442\u0438 \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0437\u043d\u0430\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u0432\u0448\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<h3><font color=\"blue\">\u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u0435<\/font><\/h3>\n<p>  \u0412 <b>4.1-rc1<\/b> \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.<\/p>\n<p>  <b>%pC[nr]<\/b><\/p>\n<p>  \u041f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0447\u0430\u0441\u0442\u043e\u0441\u0442\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u0432 struct clk.<\/p>\n<p>  <b>%pT<\/b><\/p>\n<p>  \u0412\u044b\u0432\u0435\u0434\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<h3><font color=\"blue\">\u0411\u043e\u043d\u0443\u0441\u044b<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043c\u043f\u043e\u0432 \u0431\u0443\u0444\u0435\u0440\u0430 \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0438\u0440\u0438\u0447\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>print_hex_dump()<\/code>.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ASCII &lt;\u2014&gt; binary \u0441\u043b\u0443\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0442\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<pre><code class=\"cpp\">\/* \u0412 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0432\u0438\u0434 *\/ hex_to_bin(); \/* \u043f\u043e\u043b\u0443\u0431\u0430\u0439\u0442 *\/ hex2bin(); \/* \u0431\u0443\u0444\u0435\u0440 *\/ <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/* \u0412 ASCII \u0444\u043e\u0440\u043c\u0430\u0442 *\/ hex_asc_lo(); hex_asc_hi(); \/* \u043f\u043e\u043b\u0443\u0431\u0430\u0439\u0442 *\/ hex_asc_upper_lo(); hex_asc_upper_hi(); \/* \u0442\u043e \u0436\u0435, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438 *\/ hex_byte_pack(); hex_byte_pack_upper(); \/* \u0431\u0430\u0439\u0442 *\/ bin2hex(); \/* \u0431\u0443\u0444\u0435\u0440 *\/ hex_dump_to_buffer(); \/* \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0442\u0435\u043b\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c\u043e\u0439 \u0432\u044b\u0448\u0435 print_hex_dump() *\/ <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0432\u0438\u0434\u0430 MAC \u0430\u0434\u0440\u0435\u0441, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c <code>mac_pton()<\/code>.<\/p>\n<p>  \u0423\u0434\u0430\u0447\u043d\u043e\u0439 \u043f\u0435\u0447\u0430\u0442\u0438!      \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/252453\/\"> http:\/\/habrahabr.ru\/post\/252453\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u0421\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043a\u0443\u0447\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0441\u044b\u043b\u0430\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0432 \u0441\u043f\u0438\u0441\u043a\u0438 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c \u044f\u0434\u0440\u0430 Linux \u0438\u043d\u043e\u0433\u0434\u0430 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u043a\u0430\u0442\u044c. \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0431\u044b\u0432\u0430\u0435\u0442 \u0443\u0436\u0430\u0441\u043d\u044b\u0439 \u0438 \u043d\u0435\u043f\u043e\u0442\u0440\u0435\u0431\u043d\u044b\u0439 \u043a\u043e\u0434, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u043b\u044e\u0434\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u044f\u0434\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u0432\u0441\u0435\u0445 \u0435\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  \u041a\u043d\u0438\u0433\u0430 Linux Device Drivers \u0443\u0441\u0442\u0430\u0440\u0435\u043b\u0430, \u0430 \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u044b\u0439\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u0440\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0432 \u0437\u043d\u0430\u043d\u0438\u044f\u0445 \u0442\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0438\u0448\u0443\u0442 \u043a\u043e\u0434 \u0432 \u044f\u0434\u0440\u043e.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-252623","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/252623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=252623"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/252623\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=252623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=252623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=252623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}