1 //===- CodeCoverage.cpp - Coverage tool based on profiling instrumentation-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // The 'CodeCoverageTool' class implements a command line tool to analyze and
11 // report coverage information using the profiling instrumentation and code
14 //===----------------------------------------------------------------------===//
16 #include "RenderingSupport.h"
17 #include "CoverageViewOptions.h"
18 #include "CoverageFilters.h"
19 #include "SourceCoverageDataManager.h"
20 #include "SourceCoverageView.h"
21 #include "CoverageSummary.h"
22 #include "CoverageReport.h"
23 #include "llvm/ADT/DenseMap.h"
24 #include "llvm/ADT/StringRef.h"
25 #include "llvm/ADT/SmallString.h"
26 #include "llvm/ADT/SmallSet.h"
27 #include "llvm/ADT/DenseSet.h"
28 #include "llvm/ProfileData/InstrProfReader.h"
29 #include "llvm/ProfileData/CoverageMapping.h"
30 #include "llvm/ProfileData/CoverageMappingReader.h"
31 #include "llvm/Support/CommandLine.h"
32 #include "llvm/Support/FileSystem.h"
33 #include "llvm/Support/ManagedStatic.h"
34 #include "llvm/Support/MemoryObject.h"
35 #include "llvm/Support/Format.h"
36 #include "llvm/Support/Path.h"
37 #include "llvm/Support/Signals.h"
38 #include "llvm/Support/PrettyStackTrace.h"
40 #include <system_error>
43 using namespace coverage;
46 /// \brief Distribute the functions into instantiation sets.
48 /// An instantiation set is a collection of functions that have the same source
49 /// code, ie, template functions specializations.
50 class FunctionInstantiationSetCollector {
51 typedef DenseMap<std::pair<unsigned, unsigned>,
52 std::vector<const FunctionCoverageMapping *>> MapT;
53 MapT InstantiatedFunctions;
56 void insert(const FunctionCoverageMapping &Function, unsigned FileID) {
57 auto I = Function.CountedRegions.begin(), E = Function.CountedRegions.end();
58 while (I != E && I->FileID != FileID)
60 assert(I != E && "function does not cover the given file");
61 auto &Functions = InstantiatedFunctions[I->startLoc()];
62 Functions.push_back(&Function);
65 MapT::iterator begin() {
66 return InstantiatedFunctions.begin();
69 MapT::iterator end() {
70 return InstantiatedFunctions.end();
74 /// \brief The implementation of the coverage tool.
75 class CodeCoverageTool {
78 /// \brief The show command.
80 /// \brief The report command.
84 /// \brief Print the error message to the error output stream.
85 void error(const Twine &Message, StringRef Whence = "");
87 /// \brief Return a memory buffer for the given source file.
88 ErrorOr<const MemoryBuffer &> getSourceFile(StringRef SourceFile);
90 /// \brief Collect a set of function's file ids which correspond to the
91 /// given source file. Return false if the set is empty.
92 bool gatherInterestingFileIDs(StringRef SourceFile,
93 const FunctionCoverageMapping &Function,
94 SmallSet<unsigned, 8> &InterestingFileIDs);
96 /// \brief Find the file id which is not an expanded file id.
97 bool findMainViewFileID(StringRef SourceFile,
98 const FunctionCoverageMapping &Function,
99 unsigned &MainViewFileID);
101 bool findMainViewFileID(const FunctionCoverageMapping &Function,
102 unsigned &MainViewFileID);
104 /// \brief Create a source view which shows coverage for an expansion
106 void createExpansionSubView(const CountedRegion &ExpandedRegion,
107 const FunctionCoverageMapping &Function,
108 SourceCoverageView &Parent);
110 void createExpansionSubViews(SourceCoverageView &View, unsigned ViewFileID,
111 const FunctionCoverageMapping &Function);
113 /// \brief Create a source view which shows coverage for an instantiation
115 void createInstantiationSubView(StringRef SourceFile,
116 const FunctionCoverageMapping &Function,
117 SourceCoverageView &View);
119 /// \brief Create the main source view of a particular source file.
120 /// Return true if this particular source file is not covered.
122 createSourceFileView(StringRef SourceFile, SourceCoverageView &View,
123 ArrayRef<FunctionCoverageMapping> FunctionMappingRecords,
124 bool UseOnlyRegionsInMainFile = false);
126 /// \brief Load the coverage mapping data. Return true if an error occured.
129 int run(Command Cmd, int argc, const char **argv);
131 typedef std::function<int(int, const char **)> CommandLineParserType;
133 int show(int argc, const char **argv,
134 CommandLineParserType commandLineParser);
136 int report(int argc, const char **argv,
137 CommandLineParserType commandLineParser);
139 StringRef ObjectFilename;
140 CoverageViewOptions ViewOpts;
141 std::unique_ptr<IndexedInstrProfReader> PGOReader;
142 CoverageFiltersMatchAll Filters;
143 std::vector<std::string> SourceFiles;
144 std::vector<std::pair<std::string, std::unique_ptr<MemoryBuffer>>>
146 std::vector<FunctionCoverageMapping> FunctionMappingRecords;
147 bool CompareFilenamesOnly;
148 StringMap<std::string> RemappedFilenames;
152 static std::vector<StringRef>
153 getUniqueFilenames(ArrayRef<FunctionCoverageMapping> FunctionMappingRecords) {
154 std::vector<StringRef> Filenames;
155 for (const auto &Function : FunctionMappingRecords)
156 for (const auto &Filename : Function.Filenames)
157 Filenames.push_back(Filename);
158 std::sort(Filenames.begin(), Filenames.end());
159 auto Last = std::unique(Filenames.begin(), Filenames.end());
160 Filenames.erase(Last, Filenames.end());
164 void CodeCoverageTool::error(const Twine &Message, StringRef Whence) {
167 errs() << Whence << ": ";
168 errs() << Message << "\n";
171 ErrorOr<const MemoryBuffer &>
172 CodeCoverageTool::getSourceFile(StringRef SourceFile) {
173 // If we've remapped filenames, look up the real location for this file.
174 if (!RemappedFilenames.empty()) {
175 auto Loc = RemappedFilenames.find(SourceFile);
176 if (Loc != RemappedFilenames.end())
177 SourceFile = Loc->second;
179 for (const auto &Files : LoadedSourceFiles)
180 if (sys::fs::equivalent(SourceFile, Files.first))
181 return *Files.second;
182 auto Buffer = MemoryBuffer::getFile(SourceFile);
183 if (auto EC = Buffer.getError()) {
184 error(EC.message(), SourceFile);
187 LoadedSourceFiles.push_back(
188 std::make_pair(SourceFile, std::move(Buffer.get())));
189 return *LoadedSourceFiles.back().second;
192 bool CodeCoverageTool::gatherInterestingFileIDs(
193 StringRef SourceFile, const FunctionCoverageMapping &Function,
194 SmallSet<unsigned, 8> &InterestingFileIDs) {
195 bool Interesting = false;
196 for (unsigned I = 0, E = Function.Filenames.size(); I < E; ++I) {
197 if (SourceFile == Function.Filenames[I]) {
198 InterestingFileIDs.insert(I);
206 CodeCoverageTool::findMainViewFileID(StringRef SourceFile,
207 const FunctionCoverageMapping &Function,
208 unsigned &MainViewFileID) {
209 llvm::SmallVector<bool, 8> IsExpandedFile(Function.Filenames.size(), false);
210 llvm::SmallVector<bool, 8> FilenameEquivalence(Function.Filenames.size(),
212 for (unsigned I = 0, E = Function.Filenames.size(); I < E; ++I) {
213 if (SourceFile == Function.Filenames[I])
214 FilenameEquivalence[I] = true;
216 for (const auto &CR : Function.CountedRegions) {
217 if (CR.Kind == CounterMappingRegion::ExpansionRegion &&
218 FilenameEquivalence[CR.FileID])
219 IsExpandedFile[CR.ExpandedFileID] = true;
221 for (unsigned I = 0, E = Function.Filenames.size(); I < E; ++I) {
222 if (!FilenameEquivalence[I] || IsExpandedFile[I])
231 CodeCoverageTool::findMainViewFileID(const FunctionCoverageMapping &Function,
232 unsigned &MainViewFileID) {
233 llvm::SmallVector<bool, 8> IsExpandedFile(Function.Filenames.size(), false);
234 for (const auto &CR : Function.CountedRegions) {
235 if (CR.Kind == CounterMappingRegion::ExpansionRegion)
236 IsExpandedFile[CR.ExpandedFileID] = true;
238 for (unsigned I = 0, E = Function.Filenames.size(); I < E; ++I) {
239 if (IsExpandedFile[I])
247 void CodeCoverageTool::createExpansionSubView(
248 const CountedRegion &ExpandedRegion,
249 const FunctionCoverageMapping &Function, SourceCoverageView &Parent) {
251 getSourceFile(Function.Filenames[ExpandedRegion.ExpandedFileID]);
254 auto SubView = llvm::make_unique<SourceCoverageView>(SourceBuffer.get(),
255 Parent.getOptions());
256 auto RegionManager = llvm::make_unique<SourceCoverageDataManager>();
257 for (const auto &CR : Function.CountedRegions) {
258 if (CR.FileID == ExpandedRegion.ExpandedFileID)
259 RegionManager->insert(CR);
261 SubView->load(std::move(RegionManager));
262 createExpansionSubViews(*SubView, ExpandedRegion.ExpandedFileID, Function);
263 Parent.addExpansion(ExpandedRegion, std::move(SubView));
266 void CodeCoverageTool::createExpansionSubViews(
267 SourceCoverageView &View, unsigned ViewFileID,
268 const FunctionCoverageMapping &Function) {
269 if (!ViewOpts.ShowExpandedRegions)
271 for (const auto &CR : Function.CountedRegions) {
272 if (CR.Kind != CounterMappingRegion::ExpansionRegion)
274 if (CR.FileID != ViewFileID)
276 createExpansionSubView(CR, Function, View);
280 void CodeCoverageTool::createInstantiationSubView(
281 StringRef SourceFile, const FunctionCoverageMapping &Function,
282 SourceCoverageView &View) {
283 auto RegionManager = llvm::make_unique<SourceCoverageDataManager>();
284 SmallSet<unsigned, 8> InterestingFileIDs;
285 if (!gatherInterestingFileIDs(SourceFile, Function, InterestingFileIDs))
287 // Get the interesting regions
288 for (const auto &CR : Function.CountedRegions) {
289 if (InterestingFileIDs.count(CR.FileID))
290 RegionManager->insert(CR);
292 View.load(std::move(RegionManager));
294 if (findMainViewFileID(SourceFile, Function, MainFileID))
296 createExpansionSubViews(View, MainFileID, Function);
299 bool CodeCoverageTool::createSourceFileView(
300 StringRef SourceFile, SourceCoverageView &View,
301 ArrayRef<FunctionCoverageMapping> FunctionMappingRecords,
302 bool UseOnlyRegionsInMainFile) {
303 auto RegionManager = llvm::make_unique<SourceCoverageDataManager>();
304 FunctionInstantiationSetCollector InstantiationSetCollector;
306 for (const auto &Function : FunctionMappingRecords) {
308 if (findMainViewFileID(SourceFile, Function, MainFileID))
310 SmallSet<unsigned, 8> InterestingFileIDs;
311 if (UseOnlyRegionsInMainFile) {
312 InterestingFileIDs.insert(MainFileID);
313 } else if (!gatherInterestingFileIDs(SourceFile, Function,
316 // Get the interesting regions
317 for (const auto &CR : Function.CountedRegions) {
318 if (InterestingFileIDs.count(CR.FileID))
319 RegionManager->insert(CR);
321 InstantiationSetCollector.insert(Function, MainFileID);
322 createExpansionSubViews(View, MainFileID, Function);
324 if (RegionManager->getCoverageSegments().empty())
326 View.load(std::move(RegionManager));
327 // Show instantiations
328 if (!ViewOpts.ShowFunctionInstantiations)
330 for (const auto &InstantiationSet : InstantiationSetCollector) {
331 if (InstantiationSet.second.size() < 2)
333 for (auto Function : InstantiationSet.second) {
334 unsigned FileID = Function->CountedRegions.front().FileID;
336 for (const auto &CR : Function->CountedRegions)
337 if (CR.FileID == FileID)
338 Line = std::max(CR.LineEnd, Line);
339 auto SourceBuffer = getSourceFile(Function->Filenames[FileID]);
342 auto SubView = llvm::make_unique<SourceCoverageView>(SourceBuffer.get(),
344 createInstantiationSubView(SourceFile, *Function, *SubView);
345 View.addInstantiation(Function->Name, Line, std::move(SubView));
351 bool CodeCoverageTool::load() {
352 auto CounterMappingBuff = MemoryBuffer::getFileOrSTDIN(ObjectFilename);
353 if (auto EC = CounterMappingBuff.getError()) {
354 error(EC.message(), ObjectFilename);
357 ObjectFileCoverageMappingReader MappingReader(CounterMappingBuff.get());
358 if (auto EC = MappingReader.readHeader()) {
359 error(EC.message(), ObjectFilename);
363 std::vector<uint64_t> Counts;
364 for (const auto &I : MappingReader) {
365 FunctionCoverageMapping Function(I.FunctionName, I.Filenames);
367 // Create the mapping regions with evaluated execution counts
369 PGOReader->getFunctionCounts(Function.Name, I.FunctionHash, Counts);
371 // Get the biggest referenced counters
372 bool RegionError = false;
373 CounterMappingContext Ctx(I.Expressions, Counts);
374 for (const auto &R : I.MappingRegions) {
375 // Compute the values of mapped regions
376 if (ViewOpts.Debug) {
377 errs() << "File " << R.FileID << "| " << R.LineStart << ":"
378 << R.ColumnStart << " -> " << R.LineEnd << ":" << R.ColumnEnd
381 if (R.Kind == CounterMappingRegion::ExpansionRegion) {
382 errs() << " (Expanded file id = " << R.ExpandedFileID << ") ";
386 ErrorOr<int64_t> ExecutionCount = Ctx.evaluate(R.Count);
387 if (ExecutionCount) {
388 Function.CountedRegions.push_back(CountedRegion(R, *ExecutionCount));
389 } else if (!RegionError) {
390 colored_ostream(errs(), raw_ostream::RED)
391 << "error: Regions and counters don't match in a function '"
392 << Function.Name << "' (re-run the instrumented binary).";
398 if (RegionError || !Filters.matches(Function))
401 FunctionMappingRecords.push_back(Function);
404 if (CompareFilenamesOnly) {
405 auto CoveredFiles = getUniqueFilenames(FunctionMappingRecords);
406 for (auto &SF : SourceFiles) {
407 StringRef SFBase = sys::path::filename(SF);
408 for (const auto &CF : CoveredFiles)
409 if (SFBase == sys::path::filename(CF)) {
410 RemappedFilenames[CF] = SF;
420 int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) {
421 // Print a stack trace if we signal out.
422 sys::PrintStackTraceOnErrorSignal();
423 PrettyStackTraceProgram X(argc, argv);
424 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
426 cl::list<std::string> InputSourceFiles(
427 cl::Positional, cl::desc("<Source files>"), cl::ZeroOrMore);
429 cl::opt<std::string> PGOFilename(
430 "instr-profile", cl::Required,
432 "File with the profile data obtained after an instrumented run"));
434 cl::opt<bool> DebugDump("dump", cl::Optional,
435 cl::desc("Show internal debug dump"));
437 cl::opt<bool> FilenameEquivalence(
438 "filename-equivalence", cl::Optional,
439 cl::desc("Treat source files as equivalent to paths in the coverage data "
440 "when the file names match, even if the full paths do not"));
442 cl::OptionCategory FilteringCategory("Function filtering options");
444 cl::list<std::string> NameFilters(
445 "name", cl::Optional,
446 cl::desc("Show code coverage only for functions with the given name"),
447 cl::ZeroOrMore, cl::cat(FilteringCategory));
449 cl::list<std::string> NameRegexFilters(
450 "name-regex", cl::Optional,
451 cl::desc("Show code coverage only for functions that match the given "
452 "regular expression"),
453 cl::ZeroOrMore, cl::cat(FilteringCategory));
455 cl::opt<double> RegionCoverageLtFilter(
456 "region-coverage-lt", cl::Optional,
457 cl::desc("Show code coverage only for functions with region coverage "
458 "less than the given threshold"),
459 cl::cat(FilteringCategory));
461 cl::opt<double> RegionCoverageGtFilter(
462 "region-coverage-gt", cl::Optional,
463 cl::desc("Show code coverage only for functions with region coverage "
464 "greater than the given threshold"),
465 cl::cat(FilteringCategory));
467 cl::opt<double> LineCoverageLtFilter(
468 "line-coverage-lt", cl::Optional,
469 cl::desc("Show code coverage only for functions with line coverage less "
470 "than the given threshold"),
471 cl::cat(FilteringCategory));
473 cl::opt<double> LineCoverageGtFilter(
474 "line-coverage-gt", cl::Optional,
475 cl::desc("Show code coverage only for functions with line coverage "
476 "greater than the given threshold"),
477 cl::cat(FilteringCategory));
479 auto commandLineParser = [&, this](int argc, const char **argv) -> int {
480 cl::ParseCommandLineOptions(argc, argv, "LLVM code coverage tool\n");
481 ViewOpts.Debug = DebugDump;
482 CompareFilenamesOnly = FilenameEquivalence;
484 if (auto EC = IndexedInstrProfReader::create(PGOFilename, PGOReader)) {
485 error(EC.message(), PGOFilename);
489 // Create the function filters
490 if (!NameFilters.empty() || !NameRegexFilters.empty()) {
491 auto NameFilterer = new CoverageFilters;
492 for (const auto &Name : NameFilters)
493 NameFilterer->push_back(llvm::make_unique<NameCoverageFilter>(Name));
494 for (const auto &Regex : NameRegexFilters)
495 NameFilterer->push_back(
496 llvm::make_unique<NameRegexCoverageFilter>(Regex));
497 Filters.push_back(std::unique_ptr<CoverageFilter>(NameFilterer));
499 if (RegionCoverageLtFilter.getNumOccurrences() ||
500 RegionCoverageGtFilter.getNumOccurrences() ||
501 LineCoverageLtFilter.getNumOccurrences() ||
502 LineCoverageGtFilter.getNumOccurrences()) {
503 auto StatFilterer = new CoverageFilters;
504 if (RegionCoverageLtFilter.getNumOccurrences())
505 StatFilterer->push_back(llvm::make_unique<RegionCoverageFilter>(
506 RegionCoverageFilter::LessThan, RegionCoverageLtFilter));
507 if (RegionCoverageGtFilter.getNumOccurrences())
508 StatFilterer->push_back(llvm::make_unique<RegionCoverageFilter>(
509 RegionCoverageFilter::GreaterThan, RegionCoverageGtFilter));
510 if (LineCoverageLtFilter.getNumOccurrences())
511 StatFilterer->push_back(llvm::make_unique<LineCoverageFilter>(
512 LineCoverageFilter::LessThan, LineCoverageLtFilter));
513 if (LineCoverageGtFilter.getNumOccurrences())
514 StatFilterer->push_back(llvm::make_unique<LineCoverageFilter>(
515 RegionCoverageFilter::GreaterThan, LineCoverageGtFilter));
516 Filters.push_back(std::unique_ptr<CoverageFilter>(StatFilterer));
519 for (const auto &File : InputSourceFiles) {
520 SmallString<128> Path(File);
521 if (std::error_code EC = sys::fs::make_absolute(Path)) {
522 errs() << "error: " << File << ": " << EC.message();
525 SourceFiles.push_back(Path.str());
530 // Parse the object filename
532 StringRef Arg(argv[1]);
533 if (Arg.equals_lower("-help") || Arg.equals_lower("-version")) {
534 cl::ParseCommandLineOptions(2, argv, "LLVM code coverage tool\n");
537 ObjectFilename = Arg;
543 errs() << sys::path::filename(argv[0]) << ": No executable file given!\n";
549 return show(argc, argv, commandLineParser);
551 return report(argc, argv, commandLineParser);
556 int CodeCoverageTool::show(int argc, const char **argv,
557 CommandLineParserType commandLineParser) {
559 cl::OptionCategory ViewCategory("Viewing options");
561 cl::opt<bool> ShowLineExecutionCounts(
562 "show-line-counts", cl::Optional,
563 cl::desc("Show the execution counts for each line"), cl::init(true),
564 cl::cat(ViewCategory));
566 cl::opt<bool> ShowRegions(
567 "show-regions", cl::Optional,
568 cl::desc("Show the execution counts for each region"),
569 cl::cat(ViewCategory));
571 cl::opt<bool> ShowBestLineRegionsCounts(
572 "show-line-counts-or-regions", cl::Optional,
573 cl::desc("Show the execution counts for each line, or the execution "
574 "counts for each region on lines that have multiple regions"),
575 cl::cat(ViewCategory));
577 cl::opt<bool> ShowExpansions("show-expansions", cl::Optional,
578 cl::desc("Show expanded source regions"),
579 cl::cat(ViewCategory));
581 cl::opt<bool> ShowInstantiations("show-instantiations", cl::Optional,
582 cl::desc("Show function instantiations"),
583 cl::cat(ViewCategory));
585 cl::opt<bool> NoColors("no-colors", cl::Optional,
586 cl::desc("Don't show text colors"), cl::init(false),
587 cl::cat(ViewCategory));
589 auto Err = commandLineParser(argc, argv);
593 ViewOpts.Colors = !NoColors;
594 ViewOpts.ShowLineNumbers = true;
595 ViewOpts.ShowLineStats = ShowLineExecutionCounts.getNumOccurrences() != 0 ||
596 !ShowRegions || ShowBestLineRegionsCounts;
597 ViewOpts.ShowRegionMarkers = ShowRegions || ShowBestLineRegionsCounts;
598 ViewOpts.ShowLineStatsOrRegionMarkers = ShowBestLineRegionsCounts;
599 ViewOpts.ShowExpandedRegions = ShowExpansions;
600 ViewOpts.ShowFunctionInstantiations = ShowInstantiations;
605 if (!Filters.empty()) {
607 for (const auto &Function : FunctionMappingRecords) {
609 if (findMainViewFileID(Function, MainFileID))
611 StringRef SourceFile = Function.Filenames[MainFileID];
612 auto SourceBuffer = getSourceFile(SourceFile);
615 SourceCoverageView mainView(SourceBuffer.get(), ViewOpts);
616 createSourceFileView(SourceFile, mainView, Function, true);
617 ViewOpts.colored_ostream(outs(), raw_ostream::CYAN)
618 << Function.Name << " from " << SourceFile << ":";
620 mainView.render(outs(), /*WholeFile=*/false);
621 if (FunctionMappingRecords.size() > 1)
628 bool ShowFilenames = SourceFiles.size() != 1;
630 if (SourceFiles.empty())
631 // Get the source files from the function coverage mapping
632 for (StringRef Filename : getUniqueFilenames(FunctionMappingRecords))
633 SourceFiles.push_back(Filename);
635 for (const auto &SourceFile : SourceFiles) {
636 auto SourceBuffer = getSourceFile(SourceFile);
639 SourceCoverageView mainView(SourceBuffer.get(), ViewOpts);
640 if (createSourceFileView(SourceFile, mainView, FunctionMappingRecords)) {
641 ViewOpts.colored_ostream(outs(), raw_ostream::RED)
642 << "warning: The file '" << SourceFile << "' isn't covered.";
648 ViewOpts.colored_ostream(outs(), raw_ostream::CYAN) << SourceFile << ":";
651 mainView.render(outs(), /*Wholefile=*/true);
652 if (SourceFiles.size() > 1)
659 int CodeCoverageTool::report(int argc, const char **argv,
660 CommandLineParserType commandLineParser) {
661 cl::opt<bool> NoColors("no-colors", cl::Optional,
662 cl::desc("Don't show text colors"), cl::init(false));
664 auto Err = commandLineParser(argc, argv);
668 ViewOpts.Colors = !NoColors;
673 CoverageSummary Summarizer;
674 Summarizer.createSummaries(FunctionMappingRecords);
675 CoverageReport Report(ViewOpts, Summarizer);
676 if (SourceFiles.empty() && Filters.empty()) {
677 Report.renderFileReports(llvm::outs());
681 Report.renderFunctionReports(llvm::outs());
685 int show_main(int argc, const char **argv) {
686 CodeCoverageTool Tool;
687 return Tool.run(CodeCoverageTool::Show, argc, argv);
690 int report_main(int argc, const char **argv) {
691 CodeCoverageTool Tool;
692 return Tool.run(CodeCoverageTool::Report, argc, argv);