debug code for SH-115: investigate texture related network traffic between viewer 2.x and 1.23.
parent
b5ea8b6046
commit
fcdd09772f
|
|
@ -4548,6 +4548,17 @@
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>LogTextureNetworkTraffic</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Log network traffic for textures</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>LoginAsGod</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -299,6 +299,7 @@ public:
|
|||
{
|
||||
static LLCachedControl<bool> log_to_viewer_log(gSavedSettings,"LogTextureDownloadsToViewerLog");
|
||||
static LLCachedControl<bool> log_to_sim(gSavedSettings,"LogTextureDownloadsToSimulator");
|
||||
static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ;
|
||||
|
||||
if (log_to_viewer_log || log_to_sim)
|
||||
{
|
||||
|
|
@ -332,6 +333,16 @@ public:
|
|||
}
|
||||
|
||||
S32 data_size = worker->callbackHttpGet(channels, buffer, partial, success);
|
||||
|
||||
if(log_texture_traffic && data_size > 0)
|
||||
{
|
||||
LLViewerTexture* tex = LLViewerTextureManager::findTexture(mID) ;
|
||||
if(tex)
|
||||
{
|
||||
gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size ;
|
||||
}
|
||||
}
|
||||
|
||||
mFetcher->removeFromHTTPQueue(mID, data_size);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ F32 gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f;
|
|||
U32 gTotalWorldBytes = 0, gTotalObjectBytes = 0, gTotalTextureBytes = 0, gSimPingCount = 0;
|
||||
U32 gObjectBits = 0;
|
||||
F32 gAvgSimPing = 0.f;
|
||||
|
||||
U32 gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0};
|
||||
|
||||
extern U32 gVisCompared;
|
||||
extern U32 gVisTested;
|
||||
|
|
|
|||
|
|
@ -265,4 +265,5 @@ extern std::map<S32,LLFrameTimer> gDebugTimers;
|
|||
extern std::map<S32,std::string> gDebugTimerLabel;
|
||||
extern U32 gTotalTextureBytes;
|
||||
extern U32 gTotalObjectBytes;
|
||||
extern U32 gTotalTextureBytesPerBoostLevel[] ;
|
||||
#endif // LL_LLVIEWERSTATS_H
|
||||
|
|
|
|||
|
|
@ -1161,6 +1161,8 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem)
|
|||
// static
|
||||
void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_data)
|
||||
{
|
||||
static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ;
|
||||
|
||||
LLFastTimer t(FTM_PROCESS_IMAGES);
|
||||
|
||||
// Receive image header, copy into image object and decompresses
|
||||
|
|
@ -1171,14 +1173,16 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d
|
|||
char ip_string[256];
|
||||
u32_to_ip_string(msg->getSenderIP(),ip_string);
|
||||
|
||||
U32 received_size ;
|
||||
if (msg->getReceiveCompressedSize())
|
||||
{
|
||||
gTextureList.sTextureBits += msg->getReceiveCompressedSize() * 8;
|
||||
received_size = msg->getReceiveCompressedSize() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTextureList.sTextureBits += msg->getReceiveSize() * 8;
|
||||
received_size = msg->getReceiveSize() ;
|
||||
}
|
||||
gTextureList.sTextureBits += received_size * 8;
|
||||
gTextureList.sTexturePackets++;
|
||||
|
||||
U8 codec;
|
||||
|
|
@ -1213,6 +1217,11 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d
|
|||
delete [] data;
|
||||
return;
|
||||
}
|
||||
if(log_texture_traffic)
|
||||
{
|
||||
gTotalTextureBytesPerBoostLevel[image->getBoostLevel()] += received_size ;
|
||||
}
|
||||
|
||||
//image->getLastPacketTimer()->reset();
|
||||
bool res = LLAppViewer::getTextureFetch()->receiveImageHeader(msg->getSender(), id, codec, packets, totalbytes, data_size, data);
|
||||
if (!res)
|
||||
|
|
@ -1224,6 +1233,8 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d
|
|||
// static
|
||||
void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_data)
|
||||
{
|
||||
static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ;
|
||||
|
||||
LLMemType mt1(LLMemType::MTYPE_APPFMTIMAGE);
|
||||
LLFastTimer t(FTM_PROCESS_IMAGES);
|
||||
|
||||
|
|
@ -1236,14 +1247,16 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d
|
|||
char ip_string[256];
|
||||
u32_to_ip_string(msg->getSenderIP(),ip_string);
|
||||
|
||||
U32 received_size ;
|
||||
if (msg->getReceiveCompressedSize())
|
||||
{
|
||||
gTextureList.sTextureBits += msg->getReceiveCompressedSize() * 8;
|
||||
received_size = msg->getReceiveCompressedSize() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTextureList.sTextureBits += msg->getReceiveSize() * 8;
|
||||
received_size = msg->getReceiveSize() ;
|
||||
}
|
||||
gTextureList.sTextureBits += received_size * 8;
|
||||
gTextureList.sTexturePackets++;
|
||||
|
||||
//llprintline("Start decode, image header...");
|
||||
|
|
@ -1277,6 +1290,11 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d
|
|||
delete [] data;
|
||||
return;
|
||||
}
|
||||
if(log_texture_traffic)
|
||||
{
|
||||
gTotalTextureBytesPerBoostLevel[image->getBoostLevel()] += received_size ;
|
||||
}
|
||||
|
||||
//image->getLastPacketTimer()->reset();
|
||||
bool res = LLAppViewer::getTextureFetch()->receiveImagePacket(msg->getSender(), id, packet_num, data_size, data);
|
||||
if (!res)
|
||||
|
|
|
|||
|
|
@ -304,6 +304,8 @@ public:
|
|||
|
||||
void update()
|
||||
{
|
||||
static LLCachedControl<bool> log_texture_traffic(gSavedSettings,"LogTextureNetworkTraffic") ;
|
||||
|
||||
std::string wind_vel_text;
|
||||
std::string wind_vector_text;
|
||||
std::string rwind_vel_text;
|
||||
|
|
@ -580,6 +582,23 @@ public:
|
|||
ypos += y_inc;
|
||||
}
|
||||
}
|
||||
if(log_texture_traffic)
|
||||
{
|
||||
U32 old_y = ypos ;
|
||||
for(S32 i = LLViewerTexture::BOOST_NONE; i < LLViewerTexture::MAX_GL_IMAGE_CATEGORY; i++)
|
||||
{
|
||||
if(gTotalTextureBytesPerBoostLevel[i] > 0)
|
||||
{
|
||||
addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, (F32)gTotalTextureBytesPerBoostLevel[i] / (1024 * 1024)));
|
||||
ypos += y_inc;
|
||||
}
|
||||
}
|
||||
if(ypos != old_y)
|
||||
{
|
||||
addText(xpos, ypos, "Network traffic for textures:");
|
||||
ypos += y_inc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void draw()
|
||||
|
|
|
|||
Loading…
Reference in New Issue