{"id":2856,"date":"2010-09-05T20:16:59","date_gmt":"2010-09-06T03:16:59","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=2856"},"modified":"2010-11-02T16:48:02","modified_gmt":"2010-11-02T23:48:02","slug":"using-gcovr-with-ffmpeg","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/using-gcovr-with-ffmpeg\/","title":{"rendered":"Using gcovr with FFmpeg"},"content":{"rendered":"<p>When I started <a href=\"http:\/\/multimedia.cx\/eggs\/ffmpeg-and-code-coverage-tools\/\">investigating code coverage tools to analyze FFmpeg<\/a>, I knew there had to be an easier way to do what I was trying to do (obtain code coverage statistics on a macro level for the entire project). I was hoping there was a way to ask the GNU gcov tool to do this directly. <a href=\"http:\/\/multimedia.cx\/eggs\/ffmpeg-and-code-coverage-tools\/#comment-152753\">John K informed me in the comments<\/a> of <a href=\"https:\/\/software.sandia.gov\/trac\/fast\/wiki\/gcovr\">a tool called gcovr<\/a>. Like my tool from the previous post, gcovr is a Python script that aggregates data collected by gcov. gcovr proves to be a little more competent than my tool.<\/p>\n<p><strong>Results<\/strong><br \/>\n<strong><a href=\"https:\/\/spreadsheets.google.com\/pub?key=0AjHexWy1UYqidHN4RFNYOTNPZjdna0tLa0M1MlFYMFE&#038;hl=en&#038;output=html\">Here is the spreadsheet of results<\/a><\/strong>, reflecting <a href=\"http:\/\/fate.ffmpeg.org\/\">FATE<\/a> code coverage as of this writing. All FFmpeg source files are on the same sheet this time, including header files, sorted by percent covered (ascending), then total lines (descending).<\/p>\n<p><strong>Methodology<\/strong><br \/>\nI wasn&#8217;t easily able to work with the default output from the gcovr tool. So I modified it into a tool called gcovr-csv which creates data that spreadsheets can digest more easily.<\/p>\n<ul>\n<li>Build FFmpeg using the <code>'-fprofile-arcs -ftest-coverage'<\/code> in both the extra cflags and extra ldflags configuration options<\/li>\n<li><code>'make'<\/code><\/li>\n<li><code>'make fate'<\/code><\/li>\n<li>From build directory: <code>'gcovr-csv &gt; output.csv'<\/code><\/li>\n<li>Massage the data a bit, deleting information about system header files (assuming you don&#8217;t care how much of \/usr\/include\/stdlib.h is covered &#8212; 66%, BTW)<\/li>\n<\/ul>\n<p><strong>Leftovers<\/strong><br \/>\nI became aware of some spreadsheet limitations thanks to this tool:<!--more--><\/p>\n<ol>\n<li>OpenOffice can&#8217;t process percent values correctly&#8211; it imports the percent data from the CSV file but sorts it alphabetically rather than numerically.<\/li>\n<li>Google Spreadsheet expects CSV to really be comma-delimited&#8211; forget about any other delimiters. Also, line length is an issue which is why I needed my tool to omit the uncovered line number ranges, which it does in its default state.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Having another go at analyzing FFmpeg code coverage using gcov, with the help of another tool called gcovr<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-2856","post","type-post","status-publish","format-standard","hentry","category-fate-server"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=2856"}],"version-history":[{"count":7,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2856\/revisions"}],"predecessor-version":[{"id":2978,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2856\/revisions\/2978"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=2856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=2856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=2856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}