Changeset 13658
- Timestamp:
- Jun 5, 2007, 3:08:13 PM (19 years ago)
- Location:
- trunk/ppStats/src
- Files:
-
- 6 edited
-
ppStats.c (modified) (2 diffs)
-
ppStats.h (modified) (1 diff)
-
ppStatsSetupFromArgs.c (modified) (1 diff)
-
ppStatsSetupFromRecipe.c (modified) (2 diffs)
-
ppStatsSetupFromRecipe.h (modified) (1 diff)
-
ppStatsStandAlone.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStats/src/ppStats.c
r13640 r13658 12 12 pmFPA *fpa, // FPA for which to get statistics 13 13 pmFPAview *view, // View for analysis 14 psMaskType maskVal, // Value to mask 14 15 pmConfig *config // Configuration 15 16 ) 16 17 { 17 psExit status; 18 PS_ASSERT_PTR_NON_NULL(fpa, NULL) 19 PS_ASSERT_PTR_NON_NULL(view, NULL); 20 PS_ASSERT_PTR_NON_NULL(config, NULL); 21 22 ppStatsData *data = ppStatsDataAlloc(); // All the input data 18 23 19 24 // Get the options, open the files 20 ppStatsData *data = ppStatsSetupFromRecipe(NULL, config); 25 if (!ppStatsSetupFromRecipe(data, config)) { 26 psError(PS_ERR_UNKNOWN, false, "Unable to get ppStats options from recipe."); 27 psFree(data); 28 return NULL; 29 } 30 31 // Override recipe mask value if one is provided 32 if (maskVal != 0) { 33 data->maskVal = maskVal; 34 } 21 35 22 36 if (data->fpa) { … … 31 45 32 46 // Go through the FPA and do the hard work 47 psExit status; // Status of statistics loop 33 48 psMetadata *result = ppStatsLoop(&status, out, data, config); 34 49 if (status != PS_EXIT_SUCCESS) { 35 psError (PS_ERR_UNKNOWN, false, "trouble getting stats\n");50 psError (PS_ERR_UNKNOWN, false, "Not able to measure FPA statistics.\n"); 36 51 psFree(result); 37 psFree(data);38 return (NULL);52 psFree(data); 53 return (NULL); 39 54 } 40 55 -
trunk/ppStats/src/ppStats.h
r10293 r13658 15 15 pmFPA *fpa, // FPA for which to get statistics 16 16 pmFPAview *view, // View for analysis 17 psMaskType maskVal, // Value to mask 17 18 pmConfig *config // Configuration 18 19 ); -
trunk/ppStats/src/ppStatsSetupFromArgs.c
r13640 r13658 191 191 192 192 // Get the rest from the recipe 193 ppStatsSetupFromRecipe(data, config); 193 if (!ppStatsSetupFromRecipe(data, config)) { 194 psError(PS_ERR_UNKNOWN, false, "Unable to read ppStats options from recipe."); 195 psFree(data); 196 return NULL; 197 } 194 198 195 199 // Print out what we're going to do -
trunk/ppStats/src/ppStatsSetupFromRecipe.c
r13603 r13658 14 14 // Strings in a recipe may be defined multiply (with MULTI) or listed on a single line 15 15 static void listFromRecipe(psList *target, // The target list 16 const psMetadata *recipe, // Recipe to search16 const psMetadata *recipe, // Recipe to search 17 17 const char *name // Name for item within recipe 18 18 ) … … 65 65 66 66 67 ppStatsData *ppStatsSetupFromRecipe(ppStatsData *data, // Data for running ppStats68 pmConfig *config // Configuration67 bool ppStatsSetupFromRecipe(ppStatsData *data, // Data for running ppStats 68 pmConfig *config // Configuration 69 69 ) 70 70 { 71 if (!data) { 72 data = ppStatsDataAlloc(); 73 } 71 PS_ASSERT_PTR_NON_NULL(data, false); 72 PS_ASSERT_PTR_NON_NULL(config, false); 74 73 75 74 // Determine recipe parameters -
trunk/ppStats/src/ppStatsSetupFromRecipe.h
r8337 r13658 5 5 #include "ppStatsData.h" 6 6 7 ppStatsData *ppStatsSetupFromRecipe(ppStatsData *data, // Data for running ppStats8 pmConfig *config // Configuration7 bool ppStatsSetupFromRecipe(ppStatsData *data, // Data for running ppStats 8 pmConfig *config // Configuration 9 9 ); 10 10 -
trunk/ppStats/src/ppStatsStandAlone.c
r13640 r13658 61 61 if (status != PS_EXIT_SUCCESS) { 62 62 psErrorStackPrint(stderr, "Error in stats loop.\n"); 63 exit (status);63 exit (status); 64 64 } 65 65 if (psListLength(results->list) == 0) { 66 66 psErrorStackPrint(stderr, "No output.\n"); 67 exit (status);67 exit (status); 68 68 } 69 69
Note:
See TracChangeset
for help on using the changeset viewer.
