-
Notifications
You must be signed in to change notification settings - Fork 1
update gui && utils.h #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
violet73
wants to merge
22
commits into
buaa-hipo:master
Choose a base branch
from
violet73:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a0d9f79
add hpcviewer output format
violet73 1d3fa49
Merge pull request #4 from buaa-hipo/master
violet73 191e110
Merge branch 'master' into AddHpcviewer
violet73 9ee8dd2
Merge pull request #5 from violet73/AddHpcviewer
violet73 6b0ec0a
Merge pull request #6 from buaa-hipo/master
violet73 78e5190
merge
violet73 fd367d3
print json
violet73 dbbac34
finish fp info json format dump
violet73 1369c16
add cct && rapidjson lib
violet73 289ff8f
update dc && add drcctlib_get_full_cct && fix typo
violet73 89ff192
update
violet73 4345234
update threadByteLoad != 0
violet73 35f5c07
updata dc
violet73 90c69b6
merge
violet73 4fd6bb1
merge
violet73 f92c724
add AArch64 instr_is_ignorable && add dc json dump
violet73 0ea25d6
update
violet73 1d48b8c
update util.h
violet73 b37adb8
Merge branch 'master' of https://github.com/buaa-hipo/zerospy-drcctpr…
violet73 102b59f
update
violet73 d8041ff
Merge branch 'master' of https://github.com/buaa-hipo/zerospy-drcctpr…
violet73 6f92968
merge
violet73 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2048,29 +2048,21 @@ static uint64_t PrintRedundancyPairs(per_thread_t *pt, uint64_t threadBytesLoad, | |
| break; | ||
| } | ||
| } | ||
| #if 0 | ||
| #if 1 | ||
| if(objNum<=MAX_PRINT_FULL) { | ||
| char fn[50] = {}; | ||
| sprintf(fn,"%lx.redmap",(*listIt).objID); | ||
| file_t fp = dr_open(fn,"w"); | ||
| FILE* fp = fopen(fn,"wb"); | ||
|
|
||
| for(size_t i=0;i<accmap->size;++i) { | ||
| int tmp = 1; | ||
| if(bitvec_at(accmap, i)) { | ||
| fwrite(&tmp, sizeof(char), 1, fp); | ||
| } else { | ||
| tmp = 0; | ||
| fwrite(&tmp, sizeof(char), 1, fp); | ||
| } | ||
|
|
||
| tmp = 1; | ||
| if(bitvec_at(redmap, i)) { | ||
| fwrite(&tmp, sizeof(char), 1, fp); | ||
| } else { | ||
| tmp = 0; | ||
| fwrite(&tmp, sizeof(char), 1, fp); | ||
| } | ||
| if(accmap->size > 64) { | ||
| int wSize = accmap->size / 64 + (accmap->size % 64 == 0?0:1); | ||
| fwrite(accmap->data.dyn, wSize * 8, 1, fp); | ||
| fwrite(redmap->data.dyn, wSize * 8, 1, fp); | ||
| } else { | ||
| fwrite(&accmap->data.stat, 8, 1, fp); | ||
| fwrite(&redmap->data.stat, 8, 1, fp); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个现在不能这么写了,如果数据比较大就会分页存储了;但现在内存主要消耗在cctlib那边,这个可以保留到把分页存储改回原来的低开销、高内存开销的方法 |
||
| } | ||
| fclose(fp); | ||
| dr_snprintf(keyStr, 32, "Redmap %d", dataNum); | ||
| integerRedundantInfoItem.AddMember(rapidjson::Value(keyStr, jsonAllocator), rapidjson::Value(fn, jsonAllocator), jsonAllocator); | ||
| } | ||
|
|
@@ -2184,6 +2176,9 @@ static uint64_t PrintApproximationRedundancyPairs(per_thread_t *pt, uint64_t thr | |
|
|
||
| if(grandTotalRedundantBytes==0) { | ||
| dr_fprintf(gTraceFile, "\n------------ Dumping Approx Redundancy Info Finish -------------\n"); | ||
| threadDetailedDataCentricMetrics.AddMember("Floating Point Redundant Info", floatingPointRedundantInfo, jsonAllocator); | ||
| threadDetailedMetrics.AddMember("Data Centric", threadDetailedDataCentricMetrics, jsonAllocator); | ||
| threadDetailedMetricsMap[threadId] = threadDetailedMetrics; | ||
| return grandTotalRedundantBytes; | ||
| } | ||
| sort(tmpList.begin(), tmpList.end(), ObjRedundancyCompare); | ||
|
|
@@ -2275,29 +2270,21 @@ static uint64_t PrintApproximationRedundancyPairs(per_thread_t *pt, uint64_t thr | |
| break; | ||
| } | ||
| } | ||
| #if 0 | ||
| #if 1 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同样 |
||
| if(objNum<=MAX_PRINT_FULL) { | ||
| char fn[50] = {}; | ||
| sprintf(fn,"%lx.redmap",(*listIt).objID); | ||
| file_t fp = dr_open(fn,"w"); | ||
| FILE* fp = fopen(fn,"wb"); | ||
|
|
||
| for(size_t i=0;i<accmap->size;++i) { | ||
| int tmp = 1; | ||
| if(bitvec_at(accmap, i)) { | ||
| fwrite(&tmp, sizeof(char), 1, fp); | ||
| } else { | ||
| tmp = 0; | ||
| fwrite(&tmp, sizeof(char), 1, fp); | ||
| } | ||
|
|
||
| tmp = 1; | ||
| if(bitvec_at(redmap, i)) { | ||
| fwrite(&tmp, sizeof(char), 1, fp); | ||
| } else { | ||
| tmp = 0; | ||
| fwrite(&tmp, sizeof(char), 1, fp); | ||
| } | ||
| if(accmap->size > 64) { | ||
| int wSize = accmap->size / 64 + (accmap->size % 64 == 0?0:1); | ||
| fwrite(accmap->data.dyn, wSize * 8, 1, fp); | ||
| fwrite(redmap->data.dyn, wSize * 8, 1, fp); | ||
| } else { | ||
| fwrite(&accmap->data.stat, 8, 1, fp); | ||
| fwrite(&redmap->data.stat, 8, 1, fp); | ||
| } | ||
| fclose(fp); | ||
| dr_snprintf(keyStr, 32, "Redmap %d", dataNum); | ||
| floatRedundantInfoItem.AddMember(rapidjson::Value(keyStr, jsonAllocator), rapidjson::Value(fn, jsonAllocator), jsonAllocator); | ||
| } | ||
|
|
@@ -2416,6 +2403,23 @@ ClientThreadEnd(void *drcontext) | |
| dr_fprintf(gFile, "\nRedundantBytesLoad: %lu %.2f",threadRedByteLoadINT, threadRedByteLoadINT * 100.0/threadByteLoad); | ||
| dr_fprintf(gFile, "\nApproxRedundantBytesLoad: %lu %.2f\n",threadRedByteLoadFP, threadRedByteLoadFP * 100.0/threadByteLoad); | ||
| } | ||
| rapidjson::Value threadIntegerTotal(rapidjson::kObjectType); | ||
| rapidjson::Value threadFloatTotal(rapidjson::kObjectType); | ||
|
|
||
| threadIntegerTotal.AddMember("rate", threadRedByteLoadINT * 100.0/threadByteLoad, jsonAllocator); | ||
| threadIntegerTotal.AddMember("fraction", rapidjson::Value((std::to_string(threadRedByteLoadINT) + "/" + std::to_string(threadByteLoad)).c_str(), jsonAllocator), jsonAllocator); | ||
| char detailName[32] = {}; | ||
| dr_snprintf(detailName, 32, "./thread%dDCDetail.md", threadId); | ||
| threadIntegerTotal.AddMember("detail", rapidjson::Value(detailName, jsonAllocator), | ||
| jsonAllocator); | ||
|
|
||
| threadFloatTotal.AddMember("rate", threadRedByteLoadFP * 100.0/threadByteLoad, jsonAllocator); | ||
| threadFloatTotal.AddMember("fraction", rapidjson::Value((std::to_string(threadRedByteLoadFP) + "/" + std::to_string(threadByteLoad)).c_str(), jsonAllocator), jsonAllocator); | ||
| threadFloatTotal.AddMember("detail", rapidjson::Value(detailName, jsonAllocator), | ||
| jsonAllocator); | ||
|
|
||
| totalIntegerRedundantBytes.AddMember(rapidjson::Value(("Thread " + std::to_string(threadId)).c_str(), jsonAllocator), threadIntegerTotal, jsonAllocator); | ||
| totalFloatRedundantBytes.AddMember(rapidjson::Value(("Thread " + std::to_string(threadId)).c_str(), jsonAllocator), threadFloatTotal, jsonAllocator); | ||
| dr_mutex_unlock(gLock); | ||
|
|
||
| dr_close_file(pt->output_file); | ||
|
|
@@ -2461,7 +2465,9 @@ ClientInit(int argc, const char *argv[]) | |
|
|
||
| sprintf(name+strlen(name), "/zerospy.log"); | ||
| gFile = dr_open_file(name, DR_FILE_WRITE_OVERWRITE | DR_FILE_ALLOW_LARGE); | ||
| gJson = fopen("report.json", "w"); | ||
| char gJsonName[MAXIMUM_PATH] = ""; | ||
| sprintf(gJsonName + strlen(gJsonName), "%s/report.json", g_folder_name.c_str()); | ||
| gJson = fopen(gJsonName, "w"); | ||
| DR_ASSERT(gFile != INVALID_FILE); | ||
| DR_ASSERT(gJson != NULL); | ||
| if (op_enable_sampling.get_value()) { | ||
|
|
@@ -2509,6 +2515,7 @@ ClientExit(void) | |
| metricOverview.AddMember("Total Integer Redundant Bytes", totalIntegerRedundantBytes, jsonAllocator); | ||
| metricOverview.AddMember("Total Floating Point Redundant Bytes", totalFloatRedundantBytes, jsonAllocator); | ||
| metricOverview.AddMember("Thread Num", threadDetailedMetricsMap.size(), jsonAllocator); | ||
| metricOverview.AddMember("DC", 1, jsonAllocator); | ||
| gDoc.AddMember("Metric Overview", metricOverview, jsonAllocator); | ||
|
|
||
| for(auto &threadMetrics : threadDetailedMetricsMap){ | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个改成参数选项可以调整的吧